Spaces:
Sleeping
Sleeping
KhaledAB2023
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -65,13 +65,11 @@ def process_pdf_and_ask_question(pdf_file,question):
|
|
65 |
res = chain({"question": question})
|
66 |
return res["answer"]
|
67 |
|
68 |
-
def gradio_interface(pdf,question):
|
69 |
-
return process_pdf_and_ask_question(pdf,question)
|
70 |
|
71 |
-
|
|
|
72 |
inputs=[gr.File(file_count="single", type="filepath"), gr.Textbox(lines=2, placeholder="Ask a question...")],
|
73 |
outputs="text",
|
74 |
title="PDF Q&A",
|
75 |
description="Upload a PDF and ask questions about it.",
|
76 |
-
)
|
77 |
-
app.launch()
|
|
|
65 |
res = chain({"question": question})
|
66 |
return res["answer"]
|
67 |
|
|
|
|
|
68 |
|
69 |
+
|
70 |
+
gr.Interface(fn=process_pdf_and_ask_question,
|
71 |
inputs=[gr.File(file_count="single", type="filepath"), gr.Textbox(lines=2, placeholder="Ask a question...")],
|
72 |
outputs="text",
|
73 |
title="PDF Q&A",
|
74 |
description="Upload a PDF and ask questions about it.",
|
75 |
+
).launch()
|
|