Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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(
|
|
|
|
| 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):
|