Add default file and question
Browse files
app.py
CHANGED
@@ -26,6 +26,14 @@ def answer_doc_question(pdf_file, question):
|
|
26 |
return answer["answer"]
|
27 |
|
28 |
|
29 |
-
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
gr.Interface(fn=answer_doc_question, inputs=[pdf_input, question], outputs="text").launch()
|
|
|
26 |
return answer["answer"]
|
27 |
|
28 |
|
29 |
+
# Add default a file and question, so it's easy to try out the app.
|
30 |
+
pdf_input = gr.File(
|
31 |
+
value="https://ris.uni-paderborn.de/download/30236/30237/author_version.pdf",
|
32 |
+
file_types=[".pdf"],
|
33 |
+
label="Upload a PDF document and ask a question about it.",
|
34 |
+
)
|
35 |
+
question = gr.Textbox(
|
36 |
+
value="What is mobile-env?",
|
37 |
+
label="Type a question regarding the uploaded document here.",
|
38 |
+
)
|
39 |
gr.Interface(fn=answer_doc_question, inputs=[pdf_input, question], outputs="text").launch()
|