diff --git a/open_lm/model.py b/open_lm/model.py index 52440e26..8773eda0 100644 --- a/open_lm/model.py +++ b/open_lm/model.py @@ -67,8 +67,11 @@ def _rescan_model_configs(model_config_paths=None): for cf in config_files: with open(cf, "r") as f: - model_cfg = json.load(f) - _MODEL_CONFIGS[cf.stem] = model_cfg + try: + model_cfg = json.load(f) + _MODEL_CONFIGS[cf.stem] = model_cfg + except json.JSONDecodeError: + print(f"Error loading model config {cf}") _MODEL_CONFIGS = {k: v for k, v in sorted(_MODEL_CONFIGS.items(), key=lambda x: _natural_key(x[0]))}