Skip to content

Commit

Permalink
address #131
Browse files Browse the repository at this point in the history
  • Loading branch information
painebenjamin committed Jan 21, 2024
1 parent 4118ab5 commit 52dd4e0
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/python/enfugue/api/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,13 +443,14 @@ def check_find_model(self, model_type: str, model: str) -> str:
return model
model_basename = os.path.splitext(os.path.basename(model))[0]
model_dir = self.get_configured_directory(model_type)
existing_model = find_file_in_directory(
self.engine_root,
model_basename,
extensions = [".ckpt", ".bin", ".pt", ".pth", ".safetensors"]
)
if existing_model:
return existing_model
for directory in [model_dir, self.engine_root]:
existing_model = find_file_in_directory(
directory,
model_basename,
extensions = [".ckpt", ".bin", ".pt", ".pth", ".safetensors"]
)
if existing_model:
return existing_model
check_default_model = self.get_default_model(model)
if check_default_model:
return check_default_model
Expand Down

0 comments on commit 52dd4e0

Please sign in to comment.