Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -14,9 +14,16 @@ HF_REPO_ID = "CodingBuddy/Predictive-maintenance"
|
|
| 14 |
|
| 15 |
# Download and load the model
|
| 16 |
try:
|
| 17 |
-
model_path = hf_hub_download(repo_id=HF_REPO_ID, filename="Predictive_maintenance_project_best_model.joblib", repo_type="model")
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
st.success("Model loaded successfully!")
|
|
|
|
| 20 |
except Exception as e:
|
| 21 |
st.error(f"Error loading model: {e}")
|
| 22 |
st.stop()
|
|
|
|
| 14 |
|
| 15 |
# Download and load the model
|
| 16 |
try:
|
| 17 |
+
#model_path = hf_hub_download(repo_id=HF_REPO_ID, filename="Predictive_maintenance_project_best_model.joblib", repo_type="model")
|
| 18 |
+
#hf_hub_download('https://huggingface.co/CodingBuddy/Predictive-maintenance/blob/main/Predictive_maintenance_best_model.joblib')
|
| 19 |
+
#model = joblib.load(model_path)
|
| 20 |
+
|
| 21 |
+
#https://huggingface.co/CodingBuddy/Predictive-maintenance/blob/main/Predictive_maintenance_best_model.joblib
|
| 22 |
+
# using above path , download the hf model
|
| 23 |
+
model_path_downloaded = hf_hub_download(repo_id=HF_REPO_ID, subfolder='blob/main', filename="Predictive_maintenance_project_best_model.joblib", repo_type="model")
|
| 24 |
+
model = joblib.load(model_path_downloaded)
|
| 25 |
st.success("Model loaded successfully!")
|
| 26 |
+
|
| 27 |
except Exception as e:
|
| 28 |
st.error(f"Error loading model: {e}")
|
| 29 |
st.stop()
|