Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: regression in webui with arrays and ram to leave free #245

Merged
merged 2 commits into from
Jun 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,27 +301,27 @@ 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)
elif cfgkey == "special_models_to_load" or cfgkey == "models_on_disk":
if cfgkey == "priority_usernames" or cfgkey == "blacklist" or cfgkey == "censorlist":
config[cfgkey] = self.process_input_list(value)
continue
if cfgkey == "ram_to_leave_free" or cfgkey == "vram_to_leave_free":
config[cfgkey] = str(value) + "%"
continue

if cfgkey == "special_models_to_load" or cfgkey == "models_on_disk":
models_to_load.extend(value)
elif cfgkey == "special_top_models_to_load":
if value and value != "None":
models_to_load.append(value)
elif cfgkey == "models_to_load":
models_to_load.extend(value)
elif cfgkey == "ram_to_leave_free" or cfgkey == "vram_to_leave_free":
config[cfgkey] = str(value) + "%"
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