Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -8,13 +8,18 @@ import os
|
|
| 8 |
from huggingface_hub import hf_hub_download
|
| 9 |
import joblib
|
| 10 |
|
|
|
|
|
|
|
| 11 |
model_path = hf_hub_download(
|
| 12 |
repo_id="affanthinks/superkart",
|
| 13 |
-
filename="AGreatLearning/tuned_bagging_model.pkl",
|
| 14 |
-
|
|
|
|
| 15 |
)
|
| 16 |
|
| 17 |
model = joblib.load(model_path)
|
|
|
|
|
|
|
| 18 |
|
| 19 |
|
| 20 |
# Initialize app
|
|
|
|
| 8 |
from huggingface_hub import hf_hub_download
|
| 9 |
import joblib
|
| 10 |
|
| 11 |
+
|
| 12 |
+
|
| 13 |
model_path = hf_hub_download(
|
| 14 |
repo_id="affanthinks/superkart",
|
| 15 |
+
filename="AGreatLearning/tuned_bagging_model.pkl", # include directory
|
| 16 |
+
revision="main", # ensures correct branch
|
| 17 |
+
token=os.getenv("HF_TOKEN") # authentication
|
| 18 |
)
|
| 19 |
|
| 20 |
model = joblib.load(model_path)
|
| 21 |
+
print("✅ Model loaded successfully from", model_path)
|
| 22 |
+
|
| 23 |
|
| 24 |
|
| 25 |
# Initialize app
|