dich / tools /deploy_space_linux.sh
CVNSS's picture
Upload 13 files
3f47554 verified
Raw
History Blame Contribute Delete
533 Bytes
#!/usr/bin/env bash
set -euo pipefail
HF_USER="${1:-}"
SPACE="${2:-}"
if [[ -z "$HF_USER" || -z "$SPACE" ]]; then
echo "Usage: tools/deploy_space_linux.sh HF_USERNAME SPACE_NAME"
exit 1
fi
huggingface-cli whoami >/dev/null 2>&1 || huggingface-cli login
rm -rf "$SPACE"
git clone "https://huggingface.co/spaces/$HF_USER/$SPACE" "$SPACE"
rsync -av --exclude='.git' --exclude="$SPACE" --exclude='hf_bila_translator_space.zip' ./ "$SPACE/"
cd "$SPACE"
git add .
git commit -m "Deploy Bila Translator Realtime Space" || true
git push