rishh76 commited on
Commit
d2e572f
·
verified ·
1 Parent(s): 3e90ff2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
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
- pdf_input = gr.inputs.File(label="Upload your PDF", type="file", file_count="single")
36
- query_input = gr.inputs.Textbox(label="Ask a question in PDF")
37
- output = gr.outputs.Textbox(label="Answer")
 
 
38
 
39
- gr.Interface(fn=pdf_qa, inputs=[pdf_input, query_input], outputs=output, title="PDF QA").launch()
 
 
 
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()