RAG74 / app.py
ramysaidagieb's picture
Update app.py
eb1a7ba verified
raw
history blame
557 Bytes
import gradio as gr
from rag_pipeline import load_rag_chain
# Load the RAG chain once
rag_chain = load_rag_chain()
# Gradio interface
def ask_question(query):
result = rag_chain.invoke(query)
return result['result']
iface = gr.Interface(
fn=ask_question,
inputs=gr.Textbox(lines=3, placeholder="Ask something from your PDF...", label="Your Question"),
outputs="text",
title="🧠 Custom PDF Chatbot (Hugging Face)",
description="Ask questions from your own uploaded PDF data."
)
if __name__ == "__main__":
iface.launch()