Fix crash when attempting to update a model (#4192)

## What type of PR is this? (check all applicable)

- [X] Bug Fix


## Have you discussed this change with the InvokeAI team?
- [X No, because small fix

      
## Have you updated all relevant documentation?
- [X] Yes

## Description

A logic bug was introduced in PR #4109 that caused Web-based model
updates to fail with a pydantic validation error. This corrects the
problem.

## Related Tickets & Documents

PR #4109
This commit is contained in:
Lincoln Stein 2023-08-08 10:54:27 -04:00 committed by GitHub
commit 1b1b399fd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -595,9 +595,10 @@ class ModelManager(object):
the combined format of the list_models() method.
"""
models = self.list_models(base_model, model_type, model_name)
if len(models) > 1:
if len(models) >= 1:
return models[0]
return None
else:
return None
def list_models(
self,