Spaces:
Running
Running
File size: 1,704 Bytes
05f4192 f898400 |
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 |
#!/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"
|