Spaces:
Runtime error
Runtime error
set -e | |
if [ -z "$sc4sc_token" ]; then | |
echo "β Error: Environment variable sc4sc_token is not set." | |
exit 1 | |
fi | |
# Ensure user bin is on the path | |
export PATH="$HOME/.local/bin:$PATH" | |
# Install huggingface_hub CLI if needed | |
if ! command -v huggingface-cli &> /dev/null; then | |
echo "π§ Installing huggingface_hub CLI..." | |
pip install "huggingface_hub[cli]" --break-system-packages | |
fi | |
# Secure login | |
echo "π Logging into Hugging Face CLI..." | |
huggingface-cli login --token "$sc4sc_token" > /dev/null && echo "β Login successful." | |
# Upload | |
echo "π€ Uploading to Hugging Face Space: sc4sc/editor" | |
huggingface-cli upload sc4sc/editor . --repo-type=space --include="*" --include-git-ignore=false | |
echo "β Upload completed successfully." | |