s4s-editor-beta / upload.sh
soiz1's picture
Update upload.sh
8cdfdfe verified
raw
history blame
762 Bytes
#!/bin/bash
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."