Placement_Assets / scripts /download_from_hf.sh
yuchi233's picture
Upload folder using huggingface_hub (part 7)
d76b924 verified
Raw
History Blame
421 Bytes
#!/usr/bin/env bash
set -euo pipefail
if [ "$#" -ne 2 ]; then
echo "Usage: scripts/download_from_hf.sh <namespace/dataset_repo> <local_dir>" >&2
exit 2
fi
repo_id="$1"
local_dir="$2"
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
hf download "$repo_id" --repo-type dataset --local-dir "$local_dir" --max-workers 4