File size: 391 Bytes
a20421e
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
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