Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -32,8 +32,12 @@ def pdf_qa(pdf, query):
|
|
| 32 |
return result["answer"]
|
| 33 |
return "Please upload a PDF and enter a query."
|
| 34 |
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
|
|
|
|
|
|
| 38 |
|
| 39 |
-
|
|
|
|
|
|
|
|
|
| 32 |
return result["answer"]
|
| 33 |
return "Please upload a PDF and enter a query."
|
| 34 |
|
| 35 |
+
with gr.Blocks() as demo:
|
| 36 |
+
pdf_input = gr.File(label="Upload your PDF", type="file")
|
| 37 |
+
query_input = gr.Textbox(label="Ask a question in PDF")
|
| 38 |
+
output = gr.Textbox(label="Answer")
|
| 39 |
+
submit_button = gr.Button("Submit")
|
| 40 |
|
| 41 |
+
submit_button.click(fn=pdf_qa, inputs=[pdf_input, query_input], outputs=output)
|
| 42 |
+
|
| 43 |
+
demo.launch()
|