ecg-fm-api / deploy.ps1
mystic_CBK
Initial ECG-FM API deployment
05f4192
# ECG-FM API Deployment Script (PowerShell)
# This script helps deploy your ECG-FM API to Hugging Face Spaces
Write-Host "πŸš€ ECG-FM API Deployment Script" -ForegroundColor Green
Write-Host "================================" -ForegroundColor Green
# Check if we're in the right directory
if (-not (Test-Path "server.py") -or -not (Test-Path "Dockerfile") -or -not (Test-Path "requirements.txt")) {
Write-Host "❌ Error: Please run this script from the ECG-FM directory containing server.py, Dockerfile, and requirements.txt" -ForegroundColor Red
exit 1
}
Write-Host "βœ… Found all required files" -ForegroundColor Green
Write-Host ""
# Check if git is initialized
if (-not (Test-Path ".git")) {
Write-Host "πŸ“ Initializing git repository..." -ForegroundColor Yellow
git init
git remote add origin https://huggingface.co/spaces/mystic-cbk/ecg-fm-api
Write-Host "βœ… Git repository initialized" -ForegroundColor Green
} else {
Write-Host "βœ… Git repository already exists" -ForegroundColor Green
}
Write-Host ""
Write-Host "πŸ“‹ Current git status:" -ForegroundColor Cyan
git status
Write-Host ""
Write-Host "πŸ”§ Adding all files to git..." -ForegroundColor Yellow
git add .
Write-Host ""
Write-Host "πŸ’Ύ Committing changes..." -ForegroundColor Yellow
git commit -m "Update ECG-FM API deployment"
Write-Host ""
Write-Host "πŸš€ Pushing to Hugging Face Spaces..." -ForegroundColor Yellow
git push origin main
Write-Host ""
Write-Host "βœ… Deployment initiated!" -ForegroundColor Green
Write-Host ""
Write-Host "πŸ“Š Next steps:" -ForegroundColor Cyan
Write-Host "1. Go to: https://huggingface.co/spaces/mystic-cbk/ecg-fm-api" -ForegroundColor White
Write-Host "2. Watch the build logs in the 'Build logs' tab" -ForegroundColor White
Write-Host "3. Wait for build to complete (5-15 minutes)" -ForegroundColor White
Write-Host "4. Test your API with: python test_client.py" -ForegroundColor White
Write-Host ""
Write-Host "🌐 Your API will be available at:" -ForegroundColor Cyan
Write-Host " https://mystic-cbk-ecg-fm-api.hf.space" -ForegroundColor White
Write-Host ""
Write-Host "πŸ“± Test endpoints:" -ForegroundColor Cyan
Write-Host " - Health: https://mystic-cbk-ecg-fm-api.hf.space/healthz" -ForegroundColor White
Write-Host " - Root: https://mystic-cbk-ecg-fm-api.hf.space/" -ForegroundColor White
Write-Host " - Predict: POST https://mystic-cbk-ecg-fm-api.hf.space/predict" -ForegroundColor White