Spaces:
Sleeping
Sleeping
File size: 594 Bytes
77f3883 c78cfc1 77f3883 c78cfc1 77f3883 eb1a7ba c78cfc1 eb1a7ba 77f3883 eb1a7ba |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import gradio as gr
from rag_pipeline import load_rag_chain
# Load the RAG system
rag_chain = load_rag_chain()
# Interface logic
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 (Flan-T5)",
description="Ask questions based on your uploaded PDF documents. This app runs entirely using free models."
)
if __name__ == "__main__":
iface.launch()
|