replaced the previous venv system by a conda one, allowing for better dependencies management

This commit is contained in:
faraphel 2025-01-18 14:44:46 +01:00
parent 8bf28e4c48
commit 0034c7b31a
17 changed files with 313 additions and 230 deletions

View file

@ -60,7 +60,12 @@ class ModelRegistry:
# load all the models in the library
for model_path in self.model_library.iterdir():
# get the model name
model_name: str = model_path.name
if model_name.startswith("."):
# ignore model starting with a dot
continue
model_configuration_path: Path = model_path / "config.json"
# check if the configuration file exists
@ -68,8 +73,11 @@ class ModelRegistry:
warnings.warn(f"Model {model_name!r} is missing a config.json file.")
continue
# load the configuration file
model_configuration = json.loads(model_configuration_path.read_text())
try:
# load the configuration file
model_configuration = json.loads(model_configuration_path.read_text())
except json.decoder.JSONDecodeError:
raise Exception(f"Model {model_name!r}'s configuration is invalid. See above.")
# get the model type for this model
model_type_name: str = model_configuration.get("type")