Spaces:
Runtime error
Runtime error
File size: 736 Bytes
c8abb98 06aa71a c8abb98 06aa71a c8abb98 06aa71a c8abb98 06aa71a c92ce3d c8abb98 06aa71a c8abb98 06aa71a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
#!/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."
|