Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -139,7 +139,8 @@ def demo():
|
|
139 |
qachain_btn.click(initialize_LLM, inputs=[llm_btn, slider_temperature, slider_maxtokens, slider_topk, vector_db], outputs=[qa_chain, llm_progress])
|
140 |
|
141 |
submit_btn.click(conversation, inputs=[qa_chain, msg, chatbot], outputs=[qa_chain, msg, chatbot] + doc_sources + source_pages)
|
142 |
-
msg.submit(conversation, inputs=[qa_chain, msg, chatbot], outputs=[qa_chain, msg, chatbot] + doc_sources + source_pages)
|
|
|
143 |
|
144 |
demo.queue().launch(debug=True)
|
145 |
|
|
|
139 |
qachain_btn.click(initialize_LLM, inputs=[llm_btn, slider_temperature, slider_maxtokens, slider_topk, vector_db], outputs=[qa_chain, llm_progress])
|
140 |
|
141 |
submit_btn.click(conversation, inputs=[qa_chain, msg, chatbot], outputs=[qa_chain, msg, chatbot] + doc_sources + source_pages)
|
142 |
+
msg.submit(conversation, inputs=[qa_chain, msg, chatbot], outputs=[qa_chain, msg, chatbot] + doc_sources + source_pages)
|
143 |
+
clear_btn.click(lambda: (qa_chain.reset(), chatbot.clear(), *[doc_source.clear() for doc_source in doc_sources], *[source_page.clear() for source_page in source_pages]), inputs=[qa_chain, chatbot, *doc_sources, *source_pages])
|
144 |
|
145 |
demo.queue().launch(debug=True)
|
146 |
|