From 650902dc2924f7aced87fb74906e8a444b5ae3c1 Mon Sep 17 00:00:00 2001 From: Ryan Dick Date: Wed, 10 Jul 2024 13:59:17 -0400 Subject: [PATCH] Fix broken unit test caused by non-existent model path. --- invokeai/backend/model_manager/probe.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/invokeai/backend/model_manager/probe.py b/invokeai/backend/model_manager/probe.py index 42727a31d7..1929b3f4fd 100644 --- a/invokeai/backend/model_manager/probe.py +++ b/invokeai/backend/model_manager/probe.py @@ -256,6 +256,12 @@ class ModelProbe(object): return ModelType.SpandrelImageToImage except spandrel.UnsupportedModelError: pass + except RuntimeError as e: + if "No such file or directory" in str(e): + # This error is expected if the model_path does not exist (which is the case in some unit tests). + pass + else: + raise e raise InvalidModelConfigException(f"Unable to determine model type for {model_path}")