From 602b8c6210f2e2141fc7f196b927011ca8919111 Mon Sep 17 00:00:00 2001 From: Morgan Schweers Date: Sun, 10 Dec 2023 21:51:01 -0800 Subject: [PATCH] Make new browser reloads recognize current model. (#4865) --- modules/ui_model_menu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ui_model_menu.py b/modules/ui_model_menu.py index 5b6a62f3..5d515308 100644 --- a/modules/ui_model_menu.py +++ b/modules/ui_model_menu.py @@ -58,7 +58,7 @@ def create_ui(): with gr.Row(): with gr.Column(): with gr.Row(): - shared.gradio['model_menu'] = gr.Dropdown(choices=utils.get_available_models(), value=shared.model_name, label='Model', elem_classes='slim-dropdown', interactive=not mu) + shared.gradio['model_menu'] = gr.Dropdown(choices=utils.get_available_models(), value=lambda: shared.model_name, label='Model', elem_classes='slim-dropdown', interactive=not mu) ui.create_refresh_button(shared.gradio['model_menu'], lambda: None, lambda: {'choices': utils.get_available_models()}, 'refresh-button', interactive=not mu) shared.gradio['load_model'] = gr.Button("Load", visible=not shared.settings['autoload_model'], elem_classes='refresh-button', interactive=not mu) shared.gradio['unload_model'] = gr.Button("Unload", elem_classes='refresh-button', interactive=not mu)