Use Esc to Stop the generation

This commit is contained in:
oobabooga 2023-08-03 08:13:17 -07:00
parent 3e70bce576
commit 1839dff763
2 changed files with 13 additions and 2 deletions

View file

@ -741,7 +741,7 @@ def create_interface():
with gr.Row():
shared.gradio['Generate'] = gr.Button('Generate', variant='primary', elem_classes="small-button")
shared.gradio['Stop'] = gr.Button('Stop', elem_classes="small-button")
shared.gradio['Stop'] = gr.Button('Stop', elem_classes="small-button", elem_id='stop')
shared.gradio['Undo'] = gr.Button('Undo', elem_classes="small-button")
shared.gradio['Regenerate'] = gr.Button('Regenerate', elem_classes="small-button")
@ -772,7 +772,7 @@ def create_interface():
shared.gradio['max_new_tokens'] = gr.Slider(minimum=shared.settings['max_new_tokens_min'], maximum=shared.settings['max_new_tokens_max'], step=1, label='max_new_tokens', value=shared.settings['max_new_tokens'])
with gr.Row():
shared.gradio['Generate'] = gr.Button('Generate', variant='primary')
shared.gradio['Stop'] = gr.Button('Stop')
shared.gradio['Stop'] = gr.Button('Stop', elem_id='stop')
shared.gradio['Continue'] = gr.Button('Continue')
shared.gradio['count_tokens'] = gr.Button('Count tokens')