File size: 1,747 Bytes
3c92819
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash
#############################################
# Deploy Maya1 Gradio App to HF Spaces
# Usage: ./deploy_to_hf.sh
#############################################

set -e

echo "======================================================"
echo "Maya1 - Deploy to Hugging Face Spaces"
echo "======================================================"
echo ""

# Check if we're in the right directory
if [ ! -f "app.py" ]; then
    echo "❌ Error: app.py not found!"
    echo "Please run this script from the hf_space directory"
    exit 1
fi

# Clone or update the HF Space
SPACE_DIR="../maya1-hf-space"

if [ -d "$SPACE_DIR" ]; then
    echo "πŸ“ Space directory exists, pulling latest..."
    cd "$SPACE_DIR"
    git pull
    cd -
else
    echo "πŸ“₯ Cloning HF Space..."
    echo ""
    echo "When prompted for password, use your HF access token:"
    echo "Generate one here: https://huggingface.co/settings/tokens"
    echo ""
    git clone https://huggingface.co/spaces/maya-research/maya1 "$SPACE_DIR"
fi

# Copy files
echo ""
echo "πŸ“‹ Copying files to space..."
cp app.py "$SPACE_DIR/"
cp requirements.txt "$SPACE_DIR/"
cp .gitignore "$SPACE_DIR/" 2>/dev/null || true

echo "βœ… Files copied"

# Commit and push
echo ""
echo "πŸ“€ Committing and pushing to HF Spaces..."
cd "$SPACE_DIR"
git add .
git commit -m "Update Maya1 Gradio app with preset characters" || echo "No changes to commit"
git push

echo ""
echo "======================================================"
echo "βœ… Deployment complete!"
echo "======================================================"
echo ""
echo "Your space should be live at:"
echo "https://huggingface.co/spaces/maya-research/maya1"
echo ""
echo "It may take a few minutes to build and deploy."
echo ""