Spaces:
Sleeping
Sleeping
Upload app.py with huggingface_hub
Browse files20 unmodified lines2122232425262728293020 unmodified linescache_dir = "/tmp/hf_cache"os.makedirs(cache_dir, exist_ok=True)model_path = hf_hub_download(repo_id="emp-admin/headache-predictor-xgboost",filename="model.pkl",cache_dir=cache_dir)with open(model_path, 'rb') as f:model = pickle.load(f)20 unmodified lines212223242526272829303132333420 unmodified linescache_dir = "/tmp/hf_cache"os.makedirs(cache_dir, exist_ok=True)# Get HF token from environment (set as Space secret)hf_token = os.environ.get("HF_TOKEN")model_path = hf_hub_download(repo_id="emp-admin/headache-predictor-xgboost",filename="model.pkl",cache_dir=cache_dir,token=hf_token # Use token for private repo access)with open(model_path, 'rb') as f:model = pickle.load(f)
app.py+5-1