Antoine245 commited on
Commit
89c9051
·
1 Parent(s): b033a49

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -28,7 +28,8 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
28
  chatbot = gr.Chatbot()
29
  msg = gr.Textbox()
30
  btn = gr.Button("Submit", variant="primary")
31
- gr.ClearButton([msg, chatbot])
 
32
 
33
  def user(user_message, history):
34
  return gr.update(value=""), history + [[user_message, None]]
@@ -62,6 +63,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
62
  bot, chatbot, chatbot
63
  )
64
  response.then(lambda: gr.update(interactive=True), None, [msg], queue=False)
 
65
 
66
  demo.queue()
67
  demo.launch(debug=True)
 
28
  chatbot = gr.Chatbot()
29
  msg = gr.Textbox()
30
  btn = gr.Button("Submit", variant="primary")
31
+ # gr.ClearButton([msg, chatbot])
32
+ clear = gr.Button("Clear")
33
 
34
  def user(user_message, history):
35
  return gr.update(value=""), history + [[user_message, None]]
 
63
  bot, chatbot, chatbot
64
  )
65
  response.then(lambda: gr.update(interactive=True), None, [msg], queue=False)
66
+ clear.click(lambda: None, None, chatbot, queue=False)
67
 
68
  demo.queue()
69
  demo.launch(debug=True)