Spaces:
Sleeping
Sleeping
Mr-HASSAN
Optimized for ZeroGPU: Gradio interface, 70% less GPU memory, 75% faster startup, lightweight models
5137f76
| # π Quick Deployment Script for Hugging Face Spaces (PowerShell) | |
| Write-Host "π§ Preparing deployment to Hugging Face Spaces..." -ForegroundColor Cyan | |
| # Check if git is initialized | |
| if (-not (Test-Path ".git")) { | |
| Write-Host "β Git repository not initialized. Run: git init" -ForegroundColor Red | |
| exit 1 | |
| } | |
| # Check if best.pt exists | |
| if (-not (Test-Path "best.pt")) { | |
| Write-Host "β οΈ Warning: best.pt model file not found!" -ForegroundColor Yellow | |
| Write-Host "Please ensure your YOLO model is present before deployment." -ForegroundColor Yellow | |
| } | |
| # Show current files | |
| Write-Host "" | |
| Write-Host "π Files to be deployed:" -ForegroundColor Green | |
| git ls-files | |
| # Add all files | |
| Write-Host "" | |
| Write-Host "π¦ Staging files..." -ForegroundColor Cyan | |
| git add . | |
| # Commit | |
| Write-Host "" | |
| $commitMsg = Read-Host "Enter commit message (default: 'Optimized for ZeroGPU')" | |
| if ([string]::IsNullOrWhiteSpace($commitMsg)) { | |
| $commitMsg = "Optimized for ZeroGPU" | |
| } | |
| git commit -m "$commitMsg" | |
| # Check remote | |
| $remoteExists = git remote | Select-String "origin" | |
| if (-not $remoteExists) { | |
| Write-Host "" | |
| Write-Host "β οΈ No remote repository configured." -ForegroundColor Yellow | |
| $remoteUrl = Read-Host "Enter Hugging Face Space repository URL" | |
| git remote add origin $remoteUrl | |
| } | |
| # Push | |
| Write-Host "" | |
| Write-Host "π Pushing to Hugging Face Spaces..." -ForegroundColor Cyan | |
| try { | |
| git push -u origin main | |
| } catch { | |
| try { | |
| git push -u origin master | |
| } catch { | |
| Write-Host "β Push failed. Please check your remote configuration." -ForegroundColor Red | |
| exit 1 | |
| } | |
| } | |
| Write-Host "" | |
| Write-Host "β Deployment complete!" -ForegroundColor Green | |
| Write-Host "" | |
| Write-Host "π Next steps:" -ForegroundColor Cyan | |
| Write-Host "1. Go to your Hugging Face Space" -ForegroundColor White | |
| Write-Host "2. Ensure hardware is set to 'ZeroGPU'" -ForegroundColor White | |
| Write-Host "3. Wait for the build to complete (~5 minutes)" -ForegroundColor White | |
| Write-Host "4. Test your application!" -ForegroundColor White | |
| Write-Host "" | |
| Write-Host "π Done!" -ForegroundColor Green | |