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"