| #!/usr/bin/env bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| set -euo pipefail |
|
|
| REPO="chen-gao/dualsim" |
| HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
| WHAT="${1:-all}" |
| DRY="${DRY:-0}" |
| hf_bin="$(command -v hf || echo "$HOME/.local/bin/hf")" |
|
|
| run() { |
| if [[ "$DRY" == "1" ]]; then echo "[DRY-RUN] $*"; else "$@"; fi |
| } |
|
|
| |
| |
| sync_meta() { |
| echo ">> Uploading root metadata files ..." |
| run "$hf_bin" upload "$REPO" "$HERE" . \ |
| --repo-type dataset \ |
| --exclude "eval/**" --exclude "train/**" \ |
| --exclude ".git/**" --exclude "**/__pycache__/**" --exclude "*.pyc" \ |
| --commit-message "Sync root metadata" |
| } |
|
|
| sync_eval() { |
| echo ">> Mirroring eval/ subtree (uploads changes, deletes stale) ..." |
| run "$hf_bin" upload "$REPO" "$HERE/eval" eval \ |
| --repo-type dataset \ |
| --delete "*" \ |
| --commit-message "Mirror eval" |
| } |
|
|
| sync_train() { |
| local src |
| src="$(readlink -f "$HERE/train/AgiBotWorld2026")" |
| if [[ ! -d "$src" ]]; then |
| echo "!! train/AgiBotWorld2026 does not resolve to a directory ($src) — skipping train." >&2 |
| return 0 |
| fi |
| echo ">> Mirroring train/AgiBotWorld2026 subtree from $src ..." |
| run "$hf_bin" upload "$REPO" "$src" train/AgiBotWorld2026 \ |
| --repo-type dataset \ |
| --delete "*" \ |
| --commit-message "Mirror train/AgiBotWorld2026" |
| } |
|
|
| case "$WHAT" in |
| meta) sync_meta ;; |
| eval) sync_eval ;; |
| train) sync_train ;; |
| all) sync_meta; sync_eval; sync_train ;; |
| *) echo "Usage: $0 [all|meta|eval|train] (DRY=1 for dry-run)" >&2; exit 2 ;; |
| esac |
|
|
| echo ">> Done. https://huggingface.co/datasets/$REPO" |
|
|