Spaces:
Sleeping
Sleeping
Commit ·
cb93805
1
Parent(s): f249cf5
Fix wandb login in 7B HF Job: verify env var present, use CLI not Python API
Browse files- scripts/run_hf_job_7b.sh +4 -1
scripts/run_hf_job_7b.sh
CHANGED
|
@@ -50,7 +50,10 @@ pip install --no-cache-dir -e ".[training]"
|
|
| 50 |
pip install --no-cache-dir bitsandbytes wandb
|
| 51 |
|
| 52 |
python -c "from huggingface_hub import login; login(token='${HF_TOKEN}')"
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
python - <<'PY'
|
| 56 |
from huggingface_hub import HfApi
|
|
|
|
| 50 |
pip install --no-cache-dir bitsandbytes wandb
|
| 51 |
|
| 52 |
python -c "from huggingface_hub import login; login(token='${HF_TOKEN}')"
|
| 53 |
+
# wandb login: verify the secret reached the container, then use the CLI
|
| 54 |
+
# (more resilient across wandb versions than wandb.login(key=...)).
|
| 55 |
+
test -n "${WANDB_API_KEY:-}" || { echo "ERROR: WANDB_API_KEY env var is empty in container" >&2; exit 1; }
|
| 56 |
+
HOME=/tmp wandb login --relogin "${WANDB_API_KEY}"
|
| 57 |
|
| 58 |
python - <<'PY'
|
| 59 |
from huggingface_hub import HfApi
|