Skip to content

Commit

Permalink
fix: regression in webui with arrays and ram to leave free
Browse files Browse the repository at this point in the history
  • Loading branch information
tazlin committed Jun 3, 2023
1 parent 370c389 commit d196348
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,9 @@ def save_config(self, args):
models_to_load = []
for key, value in args.items():
cfgkey = self._cfg(key.label)
if cfgkey == "priority_usernames":
config.priority_usernames = self.process_input_list(value)
elif cfgkey == "blacklist":
config.blacklist = self.process_input_list(value)
elif cfgkey == "censorlist":
config.censorlist = self.process_input_list(value)
if cfgkey == "priority_usernames" or cfgkey == "blacklist" or cfgkey == "censorlist":
config[cfgkey] = self.process_input_list(value)
continue
elif cfgkey == "special_models_to_load" or cfgkey == "models_on_disk":
models_to_load.extend(value)
elif cfgkey == "special_top_models_to_load":
Expand All @@ -316,12 +313,14 @@ def save_config(self, args):
models_to_load.extend(value)
elif cfgkey == "ram_to_leave_free" or cfgkey == "vram_to_leave_free":
config[cfgkey] = str(value) + "%"
continue
elif cfgkey == "dreamer_name" and (value == "An Awesome Dreamer" or not value):
skipped_keys.append("dreamer_name")
elif cfgkey == "scribe_name" and (value == "An Awesome Scribe" or not value):
skipped_keys.append("scribe_name")
elif cfgkey == "alchemist_name" and (value == "An Awesome Alchemist" or not value):
skipped_keys.append("alchemist_name")

config[cfgkey] = value if cfgkey != "models_to_load" else None

config["models_to_load"] = models_to_load
Expand Down

0 comments on commit d196348

Please sign in to comment.