Spaces:
Running
Running
| # Simple ECG-FM Deployment to HF Spaces | |
| Write-Host "Deploying ECG-FM Dual Model API to HF Spaces..." -ForegroundColor Green | |
| # Configuration | |
| $SPACE_NAME = "mystic-cbk-ecg-fm-api" | |
| $REPO_URL = "https://huggingface.co/spaces/mystic-cbk/$SPACE_NAME" | |
| Write-Host "Space Name: $SPACE_NAME" -ForegroundColor Yellow | |
| Write-Host "Repository: $REPO_URL" -ForegroundColor Yellow | |
| # Check git | |
| try { | |
| $gitVersion = git --version | |
| Write-Host "Git available: $gitVersion" -ForegroundColor Green | |
| } catch { | |
| Write-Host "Git not available. Please install Git first." -ForegroundColor Red | |
| exit 1 | |
| } | |
| # Initialize git if needed | |
| if (-not (Test-Path ".git")) { | |
| Write-Host "Initializing git repository..." -ForegroundColor Yellow | |
| git init | |
| git add . | |
| git commit -m "Initial commit: ECG-FM Dual Model API" | |
| } | |
| # Add and commit changes | |
| Write-Host "Adding changes to git..." -ForegroundColor Yellow | |
| git add . | |
| git commit -m "Deploy ECG-FM Dual Model API v2.0.0" | |
| # Add remote if needed | |
| $remotes = git remote -v | |
| if ($remotes -match $SPACE_NAME) { | |
| Write-Host "Remote already exists" -ForegroundColor Green | |
| } else { | |
| Write-Host "Adding remote repository..." -ForegroundColor Yellow | |
| git remote add origin $REPO_URL | |
| } | |
| # Push to HF Spaces | |
| Write-Host "Pushing to Hugging Face Spaces..." -ForegroundColor Green | |
| try { | |
| git push -u origin main --force | |
| Write-Host "Successfully pushed to HF Spaces!" -ForegroundColor Green | |
| Write-Host "Your API will be available at: $REPO_URL" -ForegroundColor Cyan | |
| } catch { | |
| Write-Host "Error pushing to HF Spaces: $_" -ForegroundColor Red | |
| exit 1 | |
| } | |
| Write-Host "Deployment completed!" -ForegroundColor Green | |