File size: 1,048 Bytes
dcd2bd2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
# Upload repo contents to Hugging Face Hub via API (avoids broken git credential helpers).
set -euo pipefail

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"

if [[ ! -f .env ]]; then
  echo "Missing .env with HF_TOKEN in $ROOT"
  exit 1
fi

set -a
# shellcheck disable=SC1091
source .env
set +a

if [[ -z "${HF_TOKEN:-}" ]]; then
  echo "HF_TOKEN is not set in .env"
  exit 1
fi

REPO_ID="psidharth567/personal_math"

echo "[*] Uploading $ROOT to https://huggingface.co/$REPO_ID (excluding .git and .env)..."
hf auth login --token "$HF_TOKEN" --add-to-git-credential 2>/dev/null || true
hf repos create "$REPO_ID" --repo-type model --exist-ok --token "$HF_TOKEN" || true

hf upload "$REPO_ID" . \
  --repo-type model \
  --token "$HF_TOKEN" \
  --exclude ".git/**" \
  --exclude ".env" \
  --exclude ".env.*" \
  --commit-message "Sync full project: code, checkpoints, datasets, logs" \
  --commit-description "Uploaded from local math denoising workspace."

echo "[+] Done: https://huggingface.co/$REPO_ID"