Spaces:
Sleeping
Sleeping
| # 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 | |