From 6cbfe19c230c482c85a733091ea47973ade9989b Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Mon, 9 Jan 2023 11:22:12 -0300 Subject: [PATCH] Submit with Shift+Enter --- server.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server.py b/server.py index d3a8ac2..9291452 100644 --- a/server.py +++ b/server.py @@ -166,6 +166,7 @@ if args.notebook: model_menu = gr.Dropdown(choices=available_models, value=model_name, label='Model') btn.click(generate_reply, [textbox, temp_slider, length_slider, preset_menu, model_menu], [textbox, markdown, html], show_progress=True) + textbox.submit(generate_reply, [textbox, temp_slider, length_slider, preset_menu, model_menu], [textbox, markdown, html], show_progress=True) elif args.chat: history = [] @@ -234,5 +235,6 @@ else: html = gr.HTML() btn.click(generate_reply, [textbox, temp_slider, length_slider, preset_menu, model_menu], [output_textbox, markdown, html], show_progress=True) + textbox.submit(generate_reply, [textbox, temp_slider, length_slider, preset_menu, model_menu], [output_textbox, markdown, html], show_progress=True) interface.launch(share=False, server_name="0.0.0.0")