Skip to content

Commit 650902d

Browse files
committed
Fix broken unit test caused by non-existent model path.
1 parent 7b5d493 commit 650902d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

invokeai/backend/model_manager/probe.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,12 @@ def get_model_type_from_checkpoint(cls, model_path: Path, checkpoint: Optional[C
256256
return ModelType.SpandrelImageToImage
257257
except spandrel.UnsupportedModelError:
258258
pass
259+
except RuntimeError as e:
260+
if "No such file or directory" in str(e):
261+
# This error is expected if the model_path does not exist (which is the case in some unit tests).
262+
pass
263+
else:
264+
raise e
259265

260266
raise InvalidModelConfigException(f"Unable to determine model type for {model_path}")
261267

0 commit comments

Comments
 (0)