Skip to content

Commit

Permalink
refactor: simplify if chain in webui
Browse files Browse the repository at this point in the history
  • Loading branch information
tazlin committed Jun 3, 2023
1 parent d196348 commit 6e871d4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,16 +304,17 @@ def save_config(self, args):
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":
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) + "%"
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):
Expand Down

0 comments on commit 6e871d4

Please sign in to comment.