Update app.py
Browse files
app.py
CHANGED
@@ -33,15 +33,15 @@ def infer(question):
|
|
33 |
|
34 |
with gr.Blocks() as demo:
|
35 |
with gr.Column():
|
36 |
-
pdf_doc = gr.File(label="Load a pdf")
|
37 |
langchain_status = gr.Textbox()
|
38 |
-
|
39 |
question = gr.Textbox(label="Your Question")
|
40 |
answer = gr.Textbox(label="Anwser")
|
41 |
|
42 |
submit_button = gr.Button("Send Question")
|
43 |
|
44 |
-
|
45 |
submit_button.click(infer, inputs=[question], outputs=[answer])
|
46 |
|
47 |
|
|
|
33 |
|
34 |
with gr.Blocks() as demo:
|
35 |
with gr.Column():
|
36 |
+
pdf_doc = gr.File(label="Load a pdf", file_types=['.pdf'], type="file")
|
37 |
langchain_status = gr.Textbox()
|
38 |
+
load_pdf = gr.Button("Load pdf to langchain")
|
39 |
question = gr.Textbox(label="Your Question")
|
40 |
answer = gr.Textbox(label="Anwser")
|
41 |
|
42 |
submit_button = gr.Button("Send Question")
|
43 |
|
44 |
+
load_pdf.click(pdf_changes, pdf_doc, langchain_status, queue=False)
|
45 |
submit_button.click(infer, inputs=[question], outputs=[answer])
|
46 |
|
47 |
|