eduardo-alvarez commited on
Commit
59a3f5e
β€’
1 Parent(s): 00e02a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -76,13 +76,17 @@ with demo:
76
  break
77
  response += char
78
  yield response
 
 
 
79
 
80
  with gr.Blocks():
81
  chatbot = gr.Chatbot()
82
  msg = gr.Textbox()
83
  clear = gr.ClearButton([msg, chatbot])
84
 
85
- msg.submit(get_response, [msg, chatbot], [msg, chatbot])
 
86
 
87
  with gr.Tabs(elem_classes="tab-buttons") as tabs:
88
  with gr.TabItem("πŸ† LLM Leadeboard", elem_id="llm-benchmark-table", id=0):
 
76
  break
77
  response += char
78
  yield response
79
+
80
+ def user(user_message, history):
81
+ return "", history + [[user_message, None]]
82
 
83
  with gr.Blocks():
84
  chatbot = gr.Chatbot()
85
  msg = gr.Textbox()
86
  clear = gr.ClearButton([msg, chatbot])
87
 
88
+ msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(get_response, chatbot, chatbot)
89
+ clear.click(lambda: None, None, chatbot, queue=False)
90
 
91
  with gr.Tabs(elem_classes="tab-buttons") as tabs:
92
  with gr.TabItem("πŸ† LLM Leadeboard", elem_id="llm-benchmark-table", id=0):