File size: 470 Bytes
d76b924
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
764dae7
d76b924
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash
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