mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
stop crash on !import_models call on model inside rootdir
- addresses bug report #1546
This commit is contained in:
parent
fdf41cc739
commit
a341297b0c
@ -178,11 +178,12 @@ class ModelCache(object):
|
|||||||
method will return True. Will fail with an assertion error if provided
|
method will return True. Will fail with an assertion error if provided
|
||||||
attributes are incorrect or the model name is missing.
|
attributes are incorrect or the model name is missing.
|
||||||
'''
|
'''
|
||||||
|
omega = self.config
|
||||||
|
|
||||||
for field in ('description','weights','height','width','config'):
|
for field in ('description','weights','height','width','config'):
|
||||||
assert field in model_attributes, f'required field {field} is missing'
|
assert field in model_attributes, f'required field {field} is missing'
|
||||||
assert (clobber or model_name not in omega), f'attempt to overwrite existing model definition "{model_name}"'
|
assert (clobber or model_name not in omega), f'attempt to overwrite existing model definition "{model_name}"'
|
||||||
|
|
||||||
omega = self.config
|
|
||||||
config = omega[model_name] if model_name in omega else {}
|
config = omega[model_name] if model_name in omega else {}
|
||||||
for field in model_attributes:
|
for field in model_attributes:
|
||||||
config[field] = model_attributes[field]
|
config[field] = model_attributes[field]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user