Skip to content

Commit

Permalink
handle model load with os
Browse files Browse the repository at this point in the history
  • Loading branch information
ckmah committed Dec 18, 2024
1 parent cfd952a commit f0a9ad9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bento/tools/_lp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import List, Union
import os
import pickle
import warnings

Expand Down Expand Up @@ -109,7 +110,7 @@ def lp(
invalid_samples = X_df.isna().any(axis=1)

# Load trained model
model_dir = "/".join(bento.__file__.split("/")[:-1]) + "/models"
model_dir = os.path.join(os.path.dirname(bento.__file__), "models")
model = pickle.load(open(f"{model_dir}/rf_calib_20220514.pkl", "rb"))

# Compatibility with newer versions of scikit-learn
Expand Down

0 comments on commit f0a9ad9

Please sign in to comment.