Download code/publish.sh from adeerkhan/msq-plurality-gap: direct link, hf CLI and curl.
- Browser
- Download file 718 Bytes
-
https://huggingface.co/adeerkhan/msq-plurality-gap/resolve/main/code/publish.sh
- Command line
-
hf download hf://adeerkhan/msq-plurality-gap/code/publish.sh
-
curl -L -o publish.sh https://huggingface.co/adeerkhan/msq-plurality-gap/resolve/main/code/publish.sh
718 Bytes
| # Publish the MSQ bucket to Hugging Face, with retries. | |
| set -u | |
| cd /home/adeerkhan/github/fatima | |
| source .venv/bin/activate | |
| export HF_TOKEN="$(cat "$HOME/.config/fatima/hf_token")" | |
| unset HF_HUB_DISABLE_XET | |
| REPO="${1:-adeerkhan/msq-plurality-gap}" | |
| for attempt in 1 2 3 4 5 6 7 8; do | |
| echo "[$(date +%T)] upload attempt $attempt" | |
| if [ "$attempt" = "1" ]; then | |
| python code/upload_bucket.py --repo "$REPO" 2>&1 | tail -40 | |
| else | |
| python code/upload_bucket.py --repo "$REPO" --no-stage 2>&1 | tail -40 | |
| fi | |
| rc=$? | |
| echo "[$(date +%T)] attempt $attempt rc=$rc" | |
| if [ "$rc" = "0" ]; then | |
| echo "UPLOAD COMPLETE" | |
| exit 0 | |
| fi | |
| sleep 10 | |
| done | |
| echo "UPLOAD FAILED AFTER 8 ATTEMPTS" | |
| exit 1 | |