Prevent extra keys from being saved to settings.yaml

This commit is contained in:
oobabooga 2023-09-11 20:13:10 -07:00
parent dae428a967
commit df123a20fc
4 changed files with 4 additions and 4 deletions

View file

@ -130,7 +130,7 @@ class Handler(BaseHTTPRequestHandler):
unload_model()
model_settings = get_model_metadata(shared.model_name)
shared.settings.update(model_settings)
shared.settings.update({k: v for k, v in model_settings.items() if k in shared.settings})
update_model_parameters(model_settings, initial=True)
if shared.settings['mode'] != 'instruct':

View file

@ -32,7 +32,7 @@ def load_model(model_name: str) -> dict:
unload_model()
model_settings = get_model_metadata(shared.model_name)
shared.settings.update(model_settings)
shared.settings.update({k: v for k, v in model_settings.items() if k in shared.settings})
update_model_parameters(model_settings, initial=True)
if shared.settings['mode'] != 'instruct':