From fc116711b03dab12e6f698cc7c028d5897ee92e8 Mon Sep 17 00:00:00 2001 From: Gabriel Terrien Date: Wed, 24 May 2023 15:01:07 +0200 Subject: [PATCH] FIX `save_model_settings` function to also update `shared.model_config` (#2282) --- server.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server.py b/server.py index 1fbbde68..49edc68c 100644 --- a/server.py +++ b/server.py @@ -289,11 +289,16 @@ def save_model_settings(model, state): user_config = {} model_regex = model + '$' # For exact matches + for _dict in [user_config, shared.model_config]: + if model_regex not in _dict: + _dict[model_regex] = {} + if model_regex not in user_config: user_config[model_regex] = {} for k in ui.list_model_elements(): user_config[model_regex][k] = state[k] + shared.model_config[model_regex][k] = state[k] with open(p, 'w') as f: f.write(yaml.dump(user_config))