chiaseacc's picture
Upload folder using huggingface_hub
c67e924 verified
Raw History Blame Contribute Delete
878 Bytes
#!/usr/bin/env bash
# Upload this folder to the Hugging Face Hub. Usage: HF_TOKEN=hf_xxx ./upload.sh <your-hf-username>
set -euo pipefail
USER_NAME="${1:-<user>}"; REPO="$USER_NAME/teencode-normalizer-v3"
: "${HF_TOKEN:?Set HF_TOKEN to a write token from https://huggingface.co/settings/tokens}"
pip install -q -U "huggingface_hub[cli]"
cd "$(dirname "$0")"
if command -v hf >/dev/null; then
hf repo create "$REPO" --repo-type model --exist-ok --token "$HF_TOKEN" || true
hf upload "$REPO" . . --repo-type model --token "$HF_TOKEN" --exclude "upload.sh" --commit-message "Upload teencode-normalizer v3"
else
huggingface-cli repo create teencode-normalizer-v3 --type model -y --token "$HF_TOKEN" || true
huggingface-cli upload "$REPO" . . --repo-type model --token "$HF_TOKEN" --commit-message "Upload teencode-normalizer v3"
fi
echo "Done: https://huggingface.co/$REPO"