mirror of https://github.com/THUDM/ChatGLM-6B
add a small feature in web_demo
Added the function of pressing the enter key to generate an answer in web_demopull/9/head
parent
4f4d3e5df0
commit
4da3176801
|
@ -34,5 +34,6 @@ with gr.Blocks() as demo:
|
||||||
txt = gr.Textbox(show_label=False, placeholder="Enter text and press enter").style(container=False)
|
txt = gr.Textbox(show_label=False, placeholder="Enter text and press enter").style(container=False)
|
||||||
with gr.Column(scale=1):
|
with gr.Column(scale=1):
|
||||||
button = gr.Button("Generate")
|
button = gr.Button("Generate")
|
||||||
|
txt.submit(predict, [txt, state], [state] + text_boxes)
|
||||||
button.click(predict, [txt, state], [state] + text_boxes)
|
button.click(predict, [txt, state], [state] + text_boxes)
|
||||||
demo.queue().launch(share=True)
|
demo.queue().launch(share=True)
|
||||||
|
|
Loading…
Reference in New Issue