Spaces:
Running
on
Zero
Running
on
Zero
File size: 1,879 Bytes
a602628 |
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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
#!/bin/bash
echo "============================================"
echo "HuggingFace Spaces Deployment Script"
echo "============================================"
echo ""
# Check if Git is installed
if ! command -v git &> /dev/null; then
echo "ERROR: Git is not installed"
echo "Please install Git first"
exit 1
fi
# Check if HuggingFace CLI is installed
if ! command -v huggingface-cli &> /dev/null; then
echo "HuggingFace CLI not found. Installing..."
pip install huggingface_hub
fi
echo ""
echo "Step 1: Login to HuggingFace"
echo "============================="
echo "You'll need your HuggingFace token from:"
echo "https://huggingface.co/settings/tokens"
echo ""
huggingface-cli login
echo ""
echo "Step 2: Enter Space Name"
echo "========================"
read -p "Enter your Space name (e.g., ace-step-custom): " SPACE_NAME
echo ""
echo "Step 3: Creating Space..."
echo "========================="
huggingface-cli repo create $SPACE_NAME --type space --space_sdk gradio
echo ""
echo "Step 4: Uploading Files..."
echo "=========================="
huggingface-cli upload $SPACE_NAME . --repo-type space \
--exclude ".git/*" \
--exclude "__pycache__/*" \
--exclude "*.pyc" \
--exclude "outputs/*" \
--exclude "timelines/*" \
--exclude "lora_training/*" \
--exclude "models/*" \
--exclude "logs/*"
echo ""
echo "============================================"
echo "Deployment Complete!"
echo "============================================"
echo ""
echo "Your Space is being built at:"
echo "https://huggingface.co/spaces/YOUR_USERNAME/$SPACE_NAME"
echo ""
echo "Next steps:"
echo "1. Visit your Space URL"
echo "2. Go to Settings and enable GPU (A10G Small recommended)"
echo "3. Wait for build to complete (5-10 minutes)"
echo "4. Test all three tabs"
echo ""
echo "For detailed instructions, see DEPLOYMENT.md"
echo ""
|