Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -93,7 +93,7 @@ def ask_question(message, history):
|
|
| 93 |
except Exception as e:
|
| 94 |
answer = f"Error:{str(e)}"
|
| 95 |
history.append((message, answer))
|
| 96 |
-
return history, history
|
| 97 |
# Building Gradio Interface
|
| 98 |
with gr.Blocks() as demo:
|
| 99 |
gr.Markdown("## Chat with your pdf!!")
|
|
@@ -110,7 +110,7 @@ with gr.Blocks() as demo:
|
|
| 110 |
|
| 111 |
file_input.change(upload_pdf, inputs=[file_input], outputs=[status])
|
| 112 |
msg.submit(ask_question, [msg, state], [chatbot, state])
|
| 113 |
-
clear.click(lambda: ([],[]), None, [chatbot, state])
|
| 114 |
chain = None # global QA chain
|
| 115 |
|
| 116 |
# Launch the app
|
|
|
|
| 93 |
except Exception as e:
|
| 94 |
answer = f"Error:{str(e)}"
|
| 95 |
history.append((message, answer))
|
| 96 |
+
return history, history, ""
|
| 97 |
# Building Gradio Interface
|
| 98 |
with gr.Blocks() as demo:
|
| 99 |
gr.Markdown("## Chat with your pdf!!")
|
|
|
|
| 110 |
|
| 111 |
file_input.change(upload_pdf, inputs=[file_input], outputs=[status])
|
| 112 |
msg.submit(ask_question, [msg, state], [chatbot, state])
|
| 113 |
+
clear.click(lambda: ([],[]), None, [chatbot, state, msg])
|
| 114 |
chain = None # global QA chain
|
| 115 |
|
| 116 |
# Launch the app
|