Ashira Pitchayapakayakul commited on
Commit
f17fac0
Β·
1 Parent(s): c311886

fix(bundle): prefer HF_TOKEN_PRO_WRITE to dodge HF_TOKEN 2500-req/5min cap

Browse files
Files changed (1) hide show
  1. bin/v3/bundle-upload.sh +7 -3
bin/v3/bundle-upload.sh CHANGED
@@ -134,15 +134,19 @@ TARBALL="$WORK/bundle.tar.gz"
134
  SIZE=$(du -sh "$TARBALL" | awk '{print $1}')
135
  log " bundle: $TARBALL ($SIZE)"
136
 
137
- if [[ -z "${HF_TOKEN:-}" ]]; then
138
- log " βœ— HF_TOKEN missing β€” set in ~/.hermes/.env"
 
 
 
139
  exit 1
140
  fi
 
141
 
142
  python3 - <<PYEOF
143
  import os
144
  from huggingface_hub import HfApi, create_repo
145
- api = HfApi(token=os.environ["HF_TOKEN"])
146
  repo = "axentx/surrogate-1-v10-source-bundle"
147
  try: create_repo(repo, repo_type="dataset", exist_ok=True, private=False)
148
  except Exception as e: print(f" create_repo: {e}")
 
134
  SIZE=$(du -sh "$TARBALL" | awk '{print $1}')
135
  log " bundle: $TARBALL ($SIZE)"
136
 
137
+ # Prefer HF_TOKEN_PRO_WRITE β€” has write scope + dedicated rate-limit pool.
138
+ # HF_TOKEN often hits 2500 req/5min ceiling from research agents.
139
+ HF_USE_TOKEN="${HF_TOKEN_PRO_WRITE:-${HF_TOKEN_PRO:-${HF_TOKEN:-}}}"
140
+ if [[ -z "$HF_USE_TOKEN" ]]; then
141
+ log " βœ— no HF token set in ~/.hermes/.env"
142
  exit 1
143
  fi
144
+ export HF_USE_TOKEN
145
 
146
  python3 - <<PYEOF
147
  import os
148
  from huggingface_hub import HfApi, create_repo
149
+ api = HfApi(token=os.environ["HF_USE_TOKEN"])
150
  repo = "axentx/surrogate-1-v10-source-bundle"
151
  try: create_repo(repo, repo_type="dataset", exist_ok=True, private=False)
152
  except Exception as e: print(f" create_repo: {e}")