File size: 1,206 Bytes
889f722
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash

# Deployment script for Hugging Face Spaces
# Usage: ./deploy.sh /path/to/your/huggingface/space

if [ $# -eq 0 ]; then
    echo "Usage: $0 <path-to-huggingface-space>"
    echo "Example: $0 /home/user/corr-steer-space"
    exit 1
fi

SPACE_PATH="$1"

if [ ! -d "$SPACE_PATH" ]; then
    echo "Error: Directory $SPACE_PATH does not exist"
    exit 1
fi

echo "Copying files to Hugging Face Space: $SPACE_PATH"

# Copy essential files
cp Dockerfile "$SPACE_PATH/"
cp README.md "$SPACE_PATH/"
cp requirements.txt "$SPACE_PATH/"
cp start.sh "$SPACE_PATH/"
cp server.py "$SPACE_PATH/"
cp config.py "$SPACE_PATH/"

# Copy directories
cp -r demo/ "$SPACE_PATH/"
cp -r features/ "$SPACE_PATH/"

# Make start.sh executable
chmod +x "$SPACE_PATH/start.sh"

echo "Files copied successfully!"
echo ""
echo "Architecture:"
echo "- Single Docker container"
echo "- Flask serves both API (/api/*) and frontend (/*)"
echo "- Frontend built as static files during Docker build"
echo "- Port 7860 for Hugging Face Spaces"
echo ""
echo "Next steps:"
echo "1. cd $SPACE_PATH"
echo "2. git add ."
echo "3. git commit -m 'Deploy CorrSteer'"
echo "4. git push origin main"
echo "5. Monitor build logs in HF Spaces"