File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
invokeai/app/services/model_records Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -292,14 +292,19 @@ def search_by_attr(
292
292
for row in result :
293
293
try :
294
294
model_config = ModelConfigFactory .make_config (json .loads (row [0 ]), timestamp = row [1 ])
295
- except pydantic .ValidationError :
295
+ except pydantic .ValidationError as e :
296
296
# We catch this error so that the app can still run if there are invalid model configs in the database.
297
297
# One reason that an invalid model config might be in the database is if someone had to rollback from a
298
298
# newer version of the app that added a new model type.
299
299
row_data = f"{ row [0 ][:64 ]} ..." if len (row [0 ]) > 64 else row [0 ]
300
+ try :
301
+ name = json .loads (row [0 ]).get ("name" , "<unknown>" )
302
+ except Exception :
303
+ name = "<unknown>"
300
304
self ._logger .warning (
301
- f"Found an invalid model config in the database. Ignoring this model. ({ row_data } )"
305
+ f"Skipping invalid model config in the database with name { name } . Ignoring this model. ({ row_data } )"
302
306
)
307
+ self ._logger .warning (f"Validation error: { e } " )
303
308
else :
304
309
results .append (model_config )
305
310
You can’t perform that action at this time.
0 commit comments