Hugo014 commited on
Commit
50debbb
·
verified ·
1 Parent(s): 866a924

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +5 -3
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", # ← Changed from Tourism-Package-Prediction
12
  filename="best_tourism_model_v2.joblib",
13
- repo_type="model", # ← Add this explicitly
14
- token=token # ← Pass 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,