Skip to content

Commit

Permalink
Fix path logic for development installs
Browse files Browse the repository at this point in the history
  • Loading branch information
palp committed Aug 4, 2023
1 parent baf79d2 commit 4e2236f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sgm/inference/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ def __init__(
self.config = str(config_path / self.specs.config)
self.ckpt = str(model_path / self.specs.ckpt)
if not os.path.exists(self.config):
# This supports development installs where configs is root level of the repo
if config_path is None:
config_path = (
pathlib.Path(__file__).parent.parent.parent.resolve() / "configs/inference"
)
raise ValueError(
f"Config {self.config} not found, check model spec or config_path"
)
Expand Down

0 comments on commit 4e2236f

Please sign in to comment.