Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -85,7 +85,8 @@ def process_file(file):
|
|
| 85 |
|
| 86 |
def chatbot(message, history):
|
| 87 |
response = handle_query(message)
|
| 88 |
-
|
|
|
|
| 89 |
|
| 90 |
# Gradio interface
|
| 91 |
with gr.Blocks() as demo:
|
|
@@ -107,9 +108,7 @@ with gr.Blocks() as demo:
|
|
| 107 |
msg = gr.Textbox(label="Ask me anything about the content of the PDF:")
|
| 108 |
clear = gr.Button("Clear")
|
| 109 |
|
| 110 |
-
msg.submit(chatbot, [msg, chatbot], [chatbot, msg])
|
| 111 |
-
lambda: gr.update(value=""), None, [msg], queue=False
|
| 112 |
-
)
|
| 113 |
clear.click(lambda: None, None, chatbot, queue=False)
|
| 114 |
|
| 115 |
if __name__ == "__main__":
|
|
|
|
| 85 |
|
| 86 |
def chatbot(message, history):
|
| 87 |
response = handle_query(message)
|
| 88 |
+
history.append((message, response))
|
| 89 |
+
return history, ""
|
| 90 |
|
| 91 |
# Gradio interface
|
| 92 |
with gr.Blocks() as demo:
|
|
|
|
| 108 |
msg = gr.Textbox(label="Ask me anything about the content of the PDF:")
|
| 109 |
clear = gr.Button("Clear")
|
| 110 |
|
| 111 |
+
msg.submit(chatbot, [msg, chatbot], [chatbot, msg])
|
|
|
|
|
|
|
| 112 |
clear.click(lambda: None, None, chatbot, queue=False)
|
| 113 |
|
| 114 |
if __name__ == "__main__":
|