Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -66,14 +66,14 @@ with gr.Blocks(css=css) as demo:
|
|
66 |
|
67 |
with gr.Column():
|
68 |
pdf_doc = gr.File(label="Load a pdf", file_types=['.pdf'], type="file")
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
chatbot = gr.Chatbot([], elem_id="chatbot").style(height=350)
|
74 |
question = gr.Textbox(label="Question", placeholder="Type your question and hit Enter ")
|
75 |
submit_btn = gr.Button("Send message")
|
76 |
#load_pdf.click(loading_pdf, None, langchain_status, queue=False)
|
|
|
77 |
load_pdf.click(pdf_changes, inputs=[pdf_doc], outputs=[langchain_status], queue=False)
|
78 |
question.submit(add_text, [chatbot, question], [chatbot, question]).then(
|
79 |
bot, chatbot, chatbot
|
|
|
66 |
|
67 |
with gr.Column():
|
68 |
pdf_doc = gr.File(label="Load a pdf", file_types=['.pdf'], type="file")
|
69 |
+
langchain_status = gr.Textbox(label="Status", placeholder="", interactive=False)
|
70 |
+
load_pdf = gr.Button("Load PDF")
|
71 |
+
Book = gr.Dropdown(label="Books", choices=["Book 1", "Book 2", "Book 3"], value=["Book 1", "Book 2", "Book 3"])
|
|
|
72 |
chatbot = gr.Chatbot([], elem_id="chatbot").style(height=350)
|
73 |
question = gr.Textbox(label="Question", placeholder="Type your question and hit Enter ")
|
74 |
submit_btn = gr.Button("Send message")
|
75 |
#load_pdf.click(loading_pdf, None, langchain_status, queue=False)
|
76 |
+
Book.change(pdf_changes, inputs=[Book], outputs=[langchain_status], queue=False)
|
77 |
load_pdf.click(pdf_changes, inputs=[pdf_doc], outputs=[langchain_status], queue=False)
|
78 |
question.submit(add_text, [chatbot, question], [chatbot, question]).then(
|
79 |
bot, chatbot, chatbot
|