sirimiri commited on
Commit
902acbb
·
1 Parent(s): cafc567

Fix HF model repo ID and add token support

Browse files
Files changed (1) hide show
  1. api.py +3 -2
api.py CHANGED
@@ -21,9 +21,10 @@ def _download_models():
21
  return
22
  try:
23
  from huggingface_hub import snapshot_download
24
- hf_repo = os.getenv("HF_MODEL_REPO", "sirimiri13/vocr-models")
 
25
  print(f"Downloading models from {hf_repo}...")
26
- snapshot_download(repo_id=hf_repo, local_dir="./models")
27
  print("Models downloaded.")
28
  except Exception as e:
29
  print(f"Model download failed: {e}")
 
21
  return
22
  try:
23
  from huggingface_hub import snapshot_download
24
+ hf_repo = os.getenv("HF_MODEL_REPO", "sirimiri/vocr-models")
25
+ hf_token = os.getenv("HF_TOKEN", None)
26
  print(f"Downloading models from {hf_repo}...")
27
+ snapshot_download(repo_id=hf_repo, local_dir="./models", token=hf_token)
28
  print("Models downloaded.")
29
  except Exception as e:
30
  print(f"Model download failed: {e}")