this fixes a crash in the TI frontend (#2527)

- 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>
This commit is contained in:
Lincoln Stein 2023-02-05 11:05:33 -05:00 committed by GitHub
parent 4895fe8395
commit 9307ce3dc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -295,7 +295,8 @@ class textualInversionForm(npyscreen.FormMultiPageAction):
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()