ecg-fm-api / deploy.sh
mystic_CBK
FIXED: Use exactly compatible versions - omegaconf 1.3.2, PyTorch 1.12.1, transformers 4.21.0. No patching needed, proven compatibility.
f898400
#!/bin/bash
# ECG-FM API Deployment Script
# This script helps deploy your ECG-FM API to Hugging Face Spaces
echo "πŸš€ ECG-FM API Deployment Script"
echo "================================"
# Check if we're in the right directory
if [ ! -f "server.py" ] || [ ! -f "Dockerfile" ] || [ ! -f "requirements.txt" ]; then
echo "❌ Error: Please run this script from the ECG-FM directory containing server.py, Dockerfile, and requirements.txt"
exit 1
fi
echo "βœ… Found all required files"
echo ""
# Check if git is initialized
if [ ! -d ".git" ]; then
echo "πŸ“ Initializing git repository..."
git init
git remote add origin https://huggingface.co/spaces/mystic-cbk/ecg-fm-api
echo "βœ… Git repository initialized"
else
echo "βœ… Git repository already exists"
fi
echo ""
echo "πŸ“‹ Current git status:"
git status
echo ""
echo "πŸ”§ Adding all files to git..."
git add .
echo ""
echo "πŸ’Ύ Committing changes..."
git commit -m "Update ECG-FM API deployment"
echo ""
echo "πŸš€ Pushing to Hugging Face Spaces..."
git push origin main
echo ""
echo "βœ… Deployment initiated!"
echo ""
echo "πŸ“Š Next steps:"
echo "1. Go to: https://huggingface.co/spaces/mystic-cbk/ecg-fm-api"
echo "2. Watch the build logs in the 'Build logs' tab"
echo "3. Wait for build to complete (5-15 minutes)"
echo "4. Test your API with: python test_client.py"
echo ""
echo "🌐 Your API will be available at:"
echo " https://mystic-cbk-ecg-fm-api.hf.space"
echo ""
echo "πŸ“± Test endpoints:"
echo " - Health: https://mystic-cbk-ecg-fm-api.hf.space/healthz"
echo " - Root: https://mystic-cbk-ecg-fm-api.hf.space/"
echo " - Predict: POST https://mystic-cbk-ecg-fm-api.hf.space/predict"