Antoine245 commited on
Commit
0c6b528
·
1 Parent(s): 61c9c77

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -27,8 +27,9 @@ chat_history = ['']
27
 
28
 
29
  with gr.Blocks() as demo:
30
- chatbot = gr.Chatbot(gr.Textbox())
31
- clear = gr.ClearButton([chatbot])
 
32
 
33
  def respond(message, chat_history):
34
  chat_history.append(message) # Initialize chat history
@@ -42,6 +43,6 @@ with gr.Blocks() as demo:
42
  time.sleep(2)
43
  return "", chat_history
44
 
45
- chatbot.on_submit(respond,[chatbot],[chatbot])
46
 
47
- demo.launch()
 
27
 
28
 
29
  with gr.Blocks() as demo:
30
+ chatbot = gr.Chatbot()
31
+ msg = gr.Textbox()
32
+ clear = gr.ClearButton([msg, chatbot])
33
 
34
  def respond(message, chat_history):
35
  chat_history.append(message) # Initialize chat history
 
43
  time.sleep(2)
44
  return "", chat_history
45
 
46
+ msg.submit(respond,[msg,chatbot],[msg,chatbot])
47
 
48
+ demo.launch()