nachikethmurthy666 commited on
Commit
391069e
·
verified ·
1 Parent(s): be06503

Update app.py

Browse files

interface of IO

Files changed (1) hide show
  1. app.py +9 -3
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
- file = gr.File(label="Upload a PDF", file_types=[".pdf"])
51
- upload_btn = gr.Button("Upload and Index")
 
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()