Skip to content

Commit 1af4eba

Browse files
committed
fix loading
1 parent c0a931a commit 1af4eba

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

autointent/_dump_tools.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,12 @@ def load( # noqa: C901, PLR0912, PLR0915
254254
msg = f"Error loading HF tokenizer {tokenizer_dir.name}: {e}"
255255
logger.exception(msg)
256256
elif child.name == Dumper.catboost_models:
257-
cat_model = CatBoostClassifier()
258-
cat_model.load_model(str(path / Dumper.catboost_models / "model.cbm"))
257+
try:
258+
cat_model = CatBoostClassifier()
259+
cat_model.load_model(str(path / Dumper.catboost_models / "model.cbm"))
260+
except Exception as e: # noqa: PERF203
261+
msg = f"Error loading CatBoost model: {e}"
262+
logger.exception(msg)
259263
else:
260264
msg = f"Found unexpected child {child}"
261265
logger.error(msg)

0 commit comments

Comments
 (0)