bupa1018 commited on
Commit
89ea156
·
verified ·
1 Parent(s): 50a81da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -8
app.py CHANGED
@@ -52,8 +52,8 @@ def show_history(chat_history):
52
  return chat_history
53
 
54
 
55
- # def reset_all():
56
- # return [], "", ""
57
 
58
 
59
  def main():
@@ -99,12 +99,7 @@ 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(
103
- lambda: ([],), # Reset chat history
104
- None,
105
- [chat_history, chatbot, user_txt],
106
- queue=False
107
- )
108
  demo.launch()
109
 
110
 
 
52
  return chat_history
53
 
54
 
55
+ def clear_history(history):
56
+ return []"
57
 
58
 
59
  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
  demo.launch()
104
 
105