Spaces:
Runtime error
Runtime error
ffreemt
commited on
Commit
·
d84480c
1
Parent(s):
f5c4b5c
Update user_clear for submit.click buttn
Browse files
app.py
CHANGED
|
@@ -64,7 +64,7 @@ def gen_model(model_name: str):
|
|
| 64 |
return model
|
| 65 |
|
| 66 |
|
| 67 |
-
def
|
| 68 |
"""Gen a response, clear message in user textbox."""
|
| 69 |
logger.debug(f"{message=}")
|
| 70 |
|
|
@@ -213,7 +213,7 @@ with gr.Blocks(
|
|
| 213 |
|
| 214 |
msg_submit_event = msg.submit(
|
| 215 |
# fn=conversation.user_turn,
|
| 216 |
-
fn=
|
| 217 |
inputs=[msg, chatbot],
|
| 218 |
outputs=[msg, chatbot],
|
| 219 |
queue=True,
|
|
@@ -222,7 +222,7 @@ with gr.Blocks(
|
|
| 222 |
).then(bot_stream_state, chatbot, chatbot, queue=True)
|
| 223 |
submit_click_event = submit.click(
|
| 224 |
# fn=lambda x, y: ("",) + user(x, y)[1:], # clear msg
|
| 225 |
-
fn=
|
| 226 |
inputs=[msg, chatbot],
|
| 227 |
outputs=[msg, chatbot],
|
| 228 |
queue=True,
|
|
|
|
| 64 |
return model
|
| 65 |
|
| 66 |
|
| 67 |
+
def user_clear(message, chat_history):
|
| 68 |
"""Gen a response, clear message in user textbox."""
|
| 69 |
logger.debug(f"{message=}")
|
| 70 |
|
|
|
|
| 213 |
|
| 214 |
msg_submit_event = msg.submit(
|
| 215 |
# fn=conversation.user_turn,
|
| 216 |
+
fn=user,
|
| 217 |
inputs=[msg, chatbot],
|
| 218 |
outputs=[msg, chatbot],
|
| 219 |
queue=True,
|
|
|
|
| 222 |
).then(bot_stream_state, chatbot, chatbot, queue=True)
|
| 223 |
submit_click_event = submit.click(
|
| 224 |
# fn=lambda x, y: ("",) + user(x, y)[1:], # clear msg
|
| 225 |
+
fn=user_clear, # clear msg
|
| 226 |
inputs=[msg, chatbot],
|
| 227 |
outputs=[msg, chatbot],
|
| 228 |
queue=True,
|