| set -euo pipefail | |
| if [ "$#" -ne 1 ]; then | |
| echo "Usage: scripts/upload_to_hf.sh <namespace/dataset_repo>" >&2 | |
| exit 2 | |
| fi | |
| repo_id="$1" | |
| if ! command -v hf >/dev/null 2>&1; then | |
| echo "ERROR: hf CLI not found. Install it with: pip install -U huggingface_hub[cli]" >&2 | |
| exit 127 | |
| fi | |
| if ! hf auth whoami >/dev/null 2>&1; then | |
| echo "ERROR: hf CLI is not logged in. Run: hf auth login" >&2 | |
| exit 1 | |
| fi | |
| hf upload "$repo_id" . . --repo-type dataset | |