mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-12-24 13:28:59 +01:00
UI: Do not save unchanged extension settings to settings.yaml
This commit is contained in:
parent
bb2c4707c4
commit
b3fc2cd887
@ -19,10 +19,9 @@ def apply_settings(extension, name):
|
||||
|
||||
for param in extension.params:
|
||||
_id = f"{name}-{param}"
|
||||
if _id not in shared.settings:
|
||||
continue
|
||||
|
||||
extension.params[param] = shared.settings[_id]
|
||||
shared.default_settings[_id] = extension.params[param]
|
||||
if _id in shared.settings:
|
||||
extension.params[param] = shared.settings[_id]
|
||||
|
||||
|
||||
def load_extensions():
|
||||
@ -40,10 +39,14 @@ def load_extensions():
|
||||
raise
|
||||
|
||||
extension = getattr(extensions, name).script
|
||||
apply_settings(extension, name)
|
||||
if extension not in setup_called and hasattr(extension, "setup"):
|
||||
|
||||
# Only run setup() and apply settings from settings.yaml once
|
||||
if extension not in setup_called:
|
||||
apply_settings(extension, name)
|
||||
if hasattr(extension, "setup"):
|
||||
extension.setup()
|
||||
|
||||
setup_called.add(extension)
|
||||
extension.setup()
|
||||
|
||||
state[name] = [True, i]
|
||||
except:
|
||||
|
@ -232,7 +232,9 @@ def save_settings(state, preset, extensions_list, show_controls, theme_state):
|
||||
params = getattr(extension, 'params')
|
||||
for param in params:
|
||||
_id = f"{extension_name}-{param}"
|
||||
output[_id] = params[param]
|
||||
# Only save if different from default value
|
||||
if param not in shared.default_settings or params[param] != shared.default_settings[param]:
|
||||
output[_id] = params[param]
|
||||
|
||||
# Do not save unchanged settings
|
||||
for key in list(output.keys()):
|
||||
|
Loading…
Reference in New Issue
Block a user