CorrSteer / deploy.sh
seonglae's picture
feat: hf space corr-steer
889f722
#!/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"