From 4aea6fa2a47c55752137a9a9ecaa46eebf58e366 Mon Sep 17 00:00:00 2001 From: Stephan Auerhahn Date: Thu, 3 Aug 2023 17:56:24 -0700 Subject: [PATCH] Fix checkpoint loading too --- sgm/inference/api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sgm/inference/api.py b/sgm/inference/api.py index a320500..2b5500c 100644 --- a/sgm/inference/api.py +++ b/sgm/inference/api.py @@ -178,6 +178,9 @@ class SamplingPipeline: if model_path is None: model_path = pathlib.Path(__file__).parent.parent.resolve() / "checkpoints" + if not os.path.exists(model_path): + # This supports development installs where checkpoints is root level of the repo + model_path = pathlib.Path(__file__).parent.parent.parent.resolve() / "checkpoints" if config_path is None: config_path = ( pathlib.Path(__file__).parent.parent.resolve() / "configs/inference"