Zishan-Shao commited on
Commit
43cec43
·
verified ·
1 Parent(s): fdfb84b

Upload scripts/upload_hf_artifacts.sh with huggingface_hub

Browse files
Files changed (1) hide show
  1. scripts/upload_hf_artifacts.sh +27 -0
scripts/upload_hf_artifacts.sh ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ REPO_ID="${REPO_ID:-Zishan-Shao/decodeshare}"
5
+ SRC_ROOT="${SRC_ROOT:-$PWD}"
6
+ HF_NUM_WORKERS="${HF_NUM_WORKERS:-4}"
7
+
8
+ if ! command -v hf >/dev/null 2>&1; then
9
+ echo "Missing Hugging Face CLI. Install with: pip install -U huggingface_hub[hf_transfer]" >&2
10
+ exit 1
11
+ fi
12
+
13
+ cd "$SRC_ROOT"
14
+
15
+ hf upload "$REPO_ID" Hype1/results/acts artifacts/Hype1/results/acts
16
+ hf upload "$REPO_ID" patch_back/results artifacts/patch_back/results
17
+
18
+ if [[ -n "${DOWNSTREAM_SPLIT_ROOT:-}" ]]; then
19
+ hf upload-large-folder "$REPO_ID" "$DOWNSTREAM_SPLIT_ROOT" \
20
+ --repo-type model \
21
+ --num-workers "$HF_NUM_WORKERS" \
22
+ --no-bars
23
+ else
24
+ echo "Skipping downstream/outputs. Create a split staging directory and set DOWNSTREAM_SPLIT_ROOT; see docs/HUGGINGFACE_UPLOAD.md." >&2
25
+ fi
26
+
27
+ echo "Uploaded selected DecodeShare artifacts to $REPO_ID"