krrishD commited on
Commit
c7fbabd
·
1 Parent(s): 970883c

now when you hit enter after typing your message, it'll also run the same functions as clicking the button

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -275,6 +275,8 @@ with gr.Blocks() as demo:
275
  btn = gr.Button("Enter message")
276
  output = gr.Chatbot().style(color_map=("green", "pink"))
277
  # allow_flagging="never",
 
 
278
  btn.click(chat, [inp, user_state], [output, user_state])
279
  btn.click(clear, inp, inp)
280
  gr.Markdown("""### need help? got feedback? have thoughts? etc. ➜ Join the [Discord](https://discord.gg/KvG3azf39U)""")
 
275
  btn = gr.Button("Enter message")
276
  output = gr.Chatbot().style(color_map=("green", "pink"))
277
  # allow_flagging="never",
278
+ inp.submit(chat, [inp, user_state], [output, user_state])
279
+ inp.submit(clear, inp, inp)
280
  btn.click(chat, [inp, user_state], [output, user_state])
281
  btn.click(clear, inp, inp)
282
  gr.Markdown("""### need help? got feedback? have thoughts? etc. ➜ Join the [Discord](https://discord.gg/KvG3azf39U)""")