Submit with Shift+Enter

This commit is contained in:
oobabooga 2023-01-09 11:22:12 -03:00
parent e2a917b3bf
commit 6cbfe19c23

View File

@ -166,6 +166,7 @@ if args.notebook:
model_menu = gr.Dropdown(choices=available_models, value=model_name, label='Model') 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) 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: elif args.chat:
history = [] history = []
@ -234,5 +235,6 @@ else:
html = gr.HTML() html = gr.HTML()
btn.click(generate_reply, [textbox, temp_slider, length_slider, preset_menu, model_menu], [output_textbox, markdown, html], show_progress=True) 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") interface.launch(share=False, server_name="0.0.0.0")