# 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