From eb0b7c1053f392a96166b8c5c741c0410eebdf4b Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sun, 24 Sep 2023 07:17:33 -0700 Subject: [PATCH] Fix a minor UI bug --- modules/loaders.py | 2 +- modules/ui_parameters.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/loaders.py b/modules/loaders.py index 460d6a27..50ebb060 100644 --- a/modules/loaders.py +++ b/modules/loaders.py @@ -305,7 +305,7 @@ loaders_samplers = { 'mirostat_mode', 'mirostat_tau', 'mirostat_eta', - 'grammar_file', + 'grammar_file_row', 'ban_eos_token', 'custom_token_bans', }, diff --git a/modules/ui_parameters.py b/modules/ui_parameters.py index f2537e8b..7e7aa667 100644 --- a/modules/ui_parameters.py +++ b/modules/ui_parameters.py @@ -108,7 +108,7 @@ def create_ui(default_preset): shared.gradio['num_beams'] = gr.Slider(1, 20, step=1, value=generate_params['num_beams'], label='num_beams', info='For Beam Search, along with length_penalty and early_stopping.') shared.gradio['length_penalty'] = gr.Slider(-5, 5, value=generate_params['length_penalty'], label='length_penalty') shared.gradio['early_stopping'] = gr.Checkbox(value=generate_params['early_stopping'], label='early_stopping') - with gr.Row(): + with gr.Row() as shared.gradio['grammar_file_row']: shared.gradio['grammar_file'] = gr.Dropdown(value='None', choices=utils.get_available_grammars(), label='Grammar file (GBNF)', elem_classes='slim-dropdown') ui.create_refresh_button(shared.gradio['grammar_file'], lambda: None, lambda: {'choices': utils.get_available_grammars()}, 'refresh-button')