Chaitanya Sagar Gurujula commited on
Commit
5c12494
·
1 Parent(s): f275595
Files changed (1) hide show
  1. src/app.py +3 -2
src/app.py CHANGED
@@ -44,11 +44,12 @@ os.environ['HF_HOME'] = str(cache_dir)
44
  # Load model from Hugging Face Hub
45
  def load_model():
46
  try:
47
- # Download the model file from HF Hub with temp directory
48
  model_path = hf_hub_download(
49
  repo_id=MODEL_ID,
50
  filename="best_model.pth",
51
- cache_dir=cache_dir
 
52
  )
53
 
54
  # Initialize our custom GPT model
 
44
  # Load model from Hugging Face Hub
45
  def load_model():
46
  try:
47
+ # Download the model file from HF Hub with authentication
48
  model_path = hf_hub_download(
49
  repo_id=MODEL_ID,
50
  filename="best_model.pth",
51
+ cache_dir=cache_dir,
52
+ token=os.environ.get('HF_TOKEN') # Get token from environment variable
53
  )
54
 
55
  # Initialize our custom GPT model