s4s-editor / upload.sh
soiz1's picture
Update upload.sh
06aa71a verified
raw
history blame
736 Bytes
#!/bin/bash
# Exit immediately if any command fails
set -e
# Check if token is set
if [ -z "$sc4sc_token" ]; then
echo "❌ Error: Environment variable sc4sc_token is not set."
exit 1
fi
# Install huggingface_hub if not already installed
if ! command -v huggingface-cli &> /dev/null; then
echo "πŸ”§ Installing huggingface_hub CLI..."
pip install huggingface_hub[cli]
fi
# Login to Hugging Face CLI using the token
echo "πŸ” Logging into Hugging Face CLI..."
echo "$sc4sc_token" | huggingface-cli login --token
# Upload current directory to the Space
echo "πŸ“€ Uploading to Hugging Face Space: sc4sc/editor"
huggingface-cli upload sc4sc/editor . --repo-type=space --include="*"
echo "βœ… Upload completed successfully."