linkscout-backend / DEPLOY_TO_HF.ps1
zpsajst's picture
Add HuggingFace Spaces deployment (16GB RAM free tier)
761248a
# Quick Deployment to HuggingFace Spaces
Write-Host "πŸš€ LinkScout - HuggingFace Spaces Deployment" -ForegroundColor Cyan
Write-Host "=" * 60
# Get HuggingFace username
$username = Read-Host "Enter your HuggingFace username"
Write-Host "`nπŸ“ Setting up HuggingFace remote..." -ForegroundColor Yellow
git remote remove hf 2>$null # Remove if exists
git remote add hf "https://huggingface.co/spaces/$username/linkscout-backend"
Write-Host "`nβœ… Remote added: https://huggingface.co/spaces/$username/linkscout-backend" -ForegroundColor Green
Write-Host "`nπŸ“¦ Committing HuggingFace files..." -ForegroundColor Yellow
git add app.py Dockerfile DEPLOY_HUGGINGFACE.md
git commit -m "Add HuggingFace Spaces deployment files" 2>$null
Write-Host "`nπŸš€ Pushing to HuggingFace..." -ForegroundColor Yellow
Write-Host "You may be asked for your HuggingFace credentials:" -ForegroundColor Gray
Write-Host " Username: $username" -ForegroundColor Gray
Write-Host " Password: Use your HuggingFace ACCESS TOKEN (not password!)" -ForegroundColor Gray
Write-Host " Get token from: https://huggingface.co/settings/tokens" -ForegroundColor Gray
Write-Host ""
git push hf main
Write-Host "`nβœ… Deployment initiated!" -ForegroundColor Green
Write-Host "`nπŸ“Š Next steps:" -ForegroundColor Cyan
Write-Host " 1. Go to: https://huggingface.co/spaces/$username/linkscout-backend" -ForegroundColor White
Write-Host " 2. Click 'Settings' tab" -ForegroundColor White
Write-Host " 3. Add Repository secrets:" -ForegroundColor White
Write-Host " - GROQ_API_KEY = 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" -ForegroundColor Gray
Write-Host " - GOOGLE_API_KEY = AIzaSyA9yKthZUnPAHFnmsnCZoikpvfUteJiX0s" -ForegroundColor Gray
Write-Host " - GOOGLE_CSE_ID = 11cbd494597034810" -ForegroundColor Gray
Write-Host " 4. Wait 10-15 minutes for build to complete" -ForegroundColor White
Write-Host " 5. Your API will be at: https://$username-linkscout-backend.hf.space" -ForegroundColor White
Write-Host "`nπŸŽ‰ Done!" -ForegroundColor Green