Spaces:
Build error
Build error
Update app.py
Browse filesinterface of IO
app.py
CHANGED
|
@@ -47,11 +47,17 @@ def query_rag(question):
|
|
| 47 |
# Gradio UI
|
| 48 |
with gr.Blocks() as demo:
|
| 49 |
gr.Markdown("## 🧠 RAG App with MMR + PDF Upload (Hugging Face Demo)")
|
| 50 |
-
|
| 51 |
-
|
|
|
|
| 52 |
status = gr.Textbox(label="Status")
|
| 53 |
-
|
| 54 |
upload_btn.click(upload_pdf, inputs=file, outputs=status)
|
| 55 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
if __name__ == "__main__":
|
| 57 |
demo.launch()
|
|
|
|
| 47 |
# Gradio UI
|
| 48 |
with gr.Blocks() as demo:
|
| 49 |
gr.Markdown("## 🧠 RAG App with MMR + PDF Upload (Hugging Face Demo)")
|
| 50 |
+
with gr.Row():
|
| 51 |
+
file = gr.File(label="Upload a PDF", file_types=[".pdf"])
|
| 52 |
+
upload_btn = gr.Button("Upload and Index")
|
| 53 |
status = gr.Textbox(label="Status")
|
|
|
|
| 54 |
upload_btn.click(upload_pdf, inputs=file, outputs=status)
|
| 55 |
|
| 56 |
+
with gr.Row():
|
| 57 |
+
question = gr.Textbox(label="Enter your question")
|
| 58 |
+
answer = gr.Textbox(label="Answer")
|
| 59 |
+
answer_btn = gr.Button("Answer")
|
| 60 |
+
answer_btn.click(query_rag, inputs=question, outputs=answer)
|
| 61 |
+
|
| 62 |
if __name__ == "__main__":
|
| 63 |
demo.launch()
|