Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -38,10 +38,9 @@ def respond(user_message, history):
|
|
38 |
with gr.Blocks() as demo:
|
39 |
chatbot = gr.Chatbot()
|
40 |
message = gr.Textbox(placeholder="Введите вопрос...")
|
41 |
-
state = gr.State([])
|
42 |
|
43 |
-
# Привязываем submit на поле ввода
|
44 |
message.submit(respond, inputs=[message, state], outputs=[chatbot, state])
|
45 |
-
message.submit(lambda: "", None, message) #
|
46 |
|
47 |
demo.launch(share=True)
|
|
|
38 |
with gr.Blocks() as demo:
|
39 |
chatbot = gr.Chatbot()
|
40 |
message = gr.Textbox(placeholder="Введите вопрос...")
|
41 |
+
state = gr.State([])
|
42 |
|
|
|
43 |
message.submit(respond, inputs=[message, state], outputs=[chatbot, state])
|
44 |
+
message.submit(lambda: "", None, message) # очистка поля ввода
|
45 |
|
46 |
demo.launch(share=True)
|