Antoine245 commited on
Commit
40d0458
·
1 Parent(s): 5b3173e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -27,7 +27,7 @@ chat_history = ['']
27
 
28
 
29
  with gr.Blocks() as demo:
30
- chatbot = gr.Textbox()
31
  msg = gr.Textbox()
32
  clear = gr.ClearButton([msg, chatbot])
33
 
@@ -38,11 +38,11 @@ with gr.Blocks() as demo:
38
  examples=examples,
39
  messages=chat_history
40
  )
41
- bot_message = str(bot_message.last) # Get the last response
42
  chat_history.append(bot_message) # Append the bot's message to the chat history
43
  time.sleep(2)
44
  return "", chat_history
45
 
46
- msg.submit(respond,[msg,chatbot],[msg,chatbot])
47
 
48
  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
 
 
38
  examples=examples,
39
  messages=chat_history
40
  )
41
+ bot_message = bot_message.last # Get the last response
42
  chat_history.append(bot_message) # Append the bot's message to the chat history
43
  time.sleep(2)
44
  return "", chat_history
45
 
46
+ msg.submit(respond,[msg,chatbot],[msg,chatbot],queue=False)
47
 
48
  demo.launch()