Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -4,14 +4,15 @@ from huggingface_hub import hf_hub_download
|
|
| 4 |
import joblib
|
| 5 |
import os
|
| 6 |
|
|
|
|
| 7 |
token = os.environ.get("HF_TOKEN")
|
| 8 |
|
| 9 |
# Download the model
|
| 10 |
model_path = hf_hub_download(
|
| 11 |
-
repo_id="Hugo014/Tourism-Model",
|
| 12 |
filename="best_tourism_model_v2.joblib",
|
| 13 |
-
repo_type="model",
|
| 14 |
-
token=token
|
| 15 |
)
|
| 16 |
model = joblib.load(model_path)
|
| 17 |
print("Model loaded successfully!")
|
|
@@ -90,6 +91,7 @@ def encode_inputs():
|
|
| 90 |
passport_encoded = 1 if passport == "Yes" else 0
|
| 91 |
|
| 92 |
return {
|
|
|
|
| 93 |
'Age': age,
|
| 94 |
'TypeofContact': contact_encoded,
|
| 95 |
'CityTier': city_tier_num,
|
|
|
|
| 4 |
import joblib
|
| 5 |
import os
|
| 6 |
|
| 7 |
+
# Get token from environment
|
| 8 |
token = os.environ.get("HF_TOKEN")
|
| 9 |
|
| 10 |
# Download the model
|
| 11 |
model_path = hf_hub_download(
|
| 12 |
+
repo_id="Hugo014/Tourism-Model",
|
| 13 |
filename="best_tourism_model_v2.joblib",
|
| 14 |
+
repo_type="model",
|
| 15 |
+
token=token
|
| 16 |
)
|
| 17 |
model = joblib.load(model_path)
|
| 18 |
print("Model loaded successfully!")
|
|
|
|
| 91 |
passport_encoded = 1 if passport == "Yes" else 0
|
| 92 |
|
| 93 |
return {
|
| 94 |
+
'Unnamed: 0': 0, # Model expects this column (dummy index)
|
| 95 |
'Age': age,
|
| 96 |
'TypeofContact': contact_encoded,
|
| 97 |
'CityTier': city_tier_num,
|