Spaces:
Sleeping
Sleeping
swamisharan
commited on
Commit
•
d17f001
1
Parent(s):
084b7de
Update app.py
Browse files
app.py
CHANGED
@@ -25,13 +25,13 @@ def answer_doc_question(pdf_file, question):
|
|
25 |
}
|
26 |
|
27 |
# Get answer
|
28 |
-
res = nlp(QA_input)
|
29 |
|
30 |
return res['answer']
|
31 |
|
32 |
# Define Gradio interface
|
33 |
-
pdf_input = gr.
|
34 |
-
question = gr.
|
35 |
iface = gr.Interface(fn=answer_doc_question, inputs=[pdf_input, question], outputs="text")
|
36 |
|
37 |
# Launch the interface
|
|
|
25 |
}
|
26 |
|
27 |
# Get answer
|
28 |
+
res = nlp(QA_input, max_answer_length=500)
|
29 |
|
30 |
return res['answer']
|
31 |
|
32 |
# Define Gradio interface
|
33 |
+
pdf_input = gr.File(type="filepath", label="Upload a PDF document and ask a question about it.")
|
34 |
+
question = gr.Textbox(label="Type a question regarding the uploaded document here.")
|
35 |
iface = gr.Interface(fn=answer_doc_question, inputs=[pdf_input, question], outputs="text")
|
36 |
|
37 |
# Launch the interface
|