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