Skip to content

Commit

Permalink
this fixes a crash in the TI frontend (#2527)
Browse files Browse the repository at this point in the history
- This fixes an edge case crash when the textual inversion frontend
  tried to display the list of models and no default model defined
  in models.yaml

Co-authored-by: Jonathan <34005131+JPPhoto@users.noreply.github.com>
  • Loading branch information
lstein and JPPhoto committed Feb 5, 2023
1 parent 4895fe8 commit 9307ce3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ldm/invoke/training/textual_inversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ def get_model_names(self) -> Tuple[List[str], int]:
for idx in range(len(model_names))
if "default" in conf[model_names[idx]]
]
return (model_names, defaults[0])
default = defaults[0] if len(defaults)>0 else 0
return (model_names, default)

def marshall_arguments(self) -> dict:
args = dict()
Expand Down

0 comments on commit 9307ce3

Please sign in to comment.