Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -82,19 +82,19 @@ def query_documents(user_query):
|
|
| 82 |
|
| 83 |
return response
|
| 84 |
|
| 85 |
-
# Gradio interface to upload PDFs
|
| 86 |
-
pdf_input = gr.inputs.File(file_count="multiple", label="Upload up to 10 PDF files")
|
| 87 |
-
query_input = gr.inputs.Textbox(label="Enter your query", placeholder="Type a question here...")
|
| 88 |
-
|
| 89 |
-
# Gradio output
|
| 90 |
-
output = gr.outputs.Textbox()
|
| 91 |
|
| 92 |
# Gradio interface combining document upload and query features
|
| 93 |
-
gr.
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
|
| 83 |
return response
|
| 84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
|
| 86 |
# Gradio interface combining document upload and query features
|
| 87 |
+
with gr.Blocks() as demo:
|
| 88 |
+
pdf_input = gr.File(file_count="multiple", label="Upload up to 10 PDF files")
|
| 89 |
+
query_input = gr.Textbox(label="Enter your query", placeholder="Type a question here...")
|
| 90 |
+
|
| 91 |
+
process_btn = gr.Button("Process PDFs")
|
| 92 |
+
query_btn = gr.Button("Query Documents")
|
| 93 |
+
|
| 94 |
+
process_output = gr.Textbox()
|
| 95 |
+
query_output = gr.Textbox()
|
| 96 |
+
|
| 97 |
+
process_btn.click(process_documents, inputs=[pdf_input], outputs=[process_output])
|
| 98 |
+
query_btn.click(query_documents, inputs=[query_input], outputs=[query_output])
|
| 99 |
+
|
| 100 |
+
demo.launch()
|