1from huggingface_hub import hf_hub_download
2import joblib
3import pandas as pd
4
5model_path = hf_hub_download(
6 repo_id="MohammedSohail/engine_maintenance_model",
7 filename="models/best_model.pkl"
8)
9
10model = joblib.load(model_path)
11
12# new_data = pd.DataFrame([
13# [750, 3.5, 6.0, 2.5, 80.0, 75.0] # Example sensor values
14# ], columns=['Engine rpm', 'Lub oil pressure', 'Fuel pressure', 'Coolant pressure', 'lub oil temp', 'Coolant temp'])
15# prediction = model.predict(new_data)
16# print(f"Predicted Engine Condition: {prediction[0]} (0=Normal, 1=Faulty)")