Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -99,12 +99,12 @@ def main():
|
|
| 99 |
.then(kadi_bot.handle_chat, [chat_history], [chatbot])
|
| 100 |
submit_btn.click(add_text_to_chat_history, [chat_history, user_txt], [chat_history, user_txt]).then(show_history, [chat_history], [chatbot])\
|
| 101 |
.then(kadi_bot.handle_chat, [chat_history], [chatbot])
|
| 102 |
-
# clear_btn.click(clear_history, inputs = [chat_history], outputs =chat_history)
|
| 103 |
clear_btn.click(
|
| 104 |
-
lambda
|
| 105 |
-
[
|
| 106 |
-
[chat_history]
|
| 107 |
)
|
|
|
|
| 108 |
demo.launch()
|
| 109 |
|
| 110 |
|
|
|
|
| 99 |
.then(kadi_bot.handle_chat, [chat_history], [chatbot])
|
| 100 |
submit_btn.click(add_text_to_chat_history, [chat_history, user_txt], [chat_history, user_txt]).then(show_history, [chat_history], [chatbot])\
|
| 101 |
.then(kadi_bot.handle_chat, [chat_history], [chatbot])
|
|
|
|
| 102 |
clear_btn.click(
|
| 103 |
+
lambda: ([], gr.update(value=[])), # Clear chat_history and reset chatbot display
|
| 104 |
+
[],
|
| 105 |
+
[chat_history, chatbot] # Update both chat_history and chatbot UI
|
| 106 |
)
|
| 107 |
+
|
| 108 |
demo.launch()
|
| 109 |
|
| 110 |
|