predictive-maintenance-app / model_loader.py
labhara's picture
Upload model_loader.py
a20421e verified
raw
history blame contribute delete
391 Bytes
from huggingface_hub import hf_hub_download
import joblib
def load_model():
# Download model file from Hugging Face Model Hub
model_path = hf_hub_download(
repo_id="labhara/predictive-maintenance-bestmodel",
filename="GradientBoosting_model.pkl"
)
model = joblib.load(model_path)
model.expected_features = list(model.feature_names_in_)
return model