# ============================================================ # DiffusionGemma Humanizer — Modal Pipeline Launcher # ============================================================ # Everything runs on Modal (single A100 80GB). # Nothing is downloaded locally. # # PREREQUISITES (one-time setup): # 1. Install Modal CLI: pip install modal # 2. Authenticate: modal setup # 3. Create HF secret: modal secret create hf-secrets HF_TOKEN=hf_your_token # # USAGE: # pwsh scripts/run_pipeline.ps1 # ============================================================ $ErrorActionPreference = "Stop" $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path $RootDir = Split-Path -Parent $ScriptDir Write-Host "" Write-Host "================================================================" -ForegroundColor Cyan Write-Host " DiffusionGemma Humanizer — SOTA Text Humanization" -ForegroundColor Cyan Write-Host " GPU: Single A100 80GB | Platform: Modal" -ForegroundColor Cyan Write-Host "================================================================" -ForegroundColor Cyan Write-Host "" # Check Modal CLI $modalVersion = modal --version 2>&1 if ($LASTEXITCODE -ne 0) { Write-Host "[FAIL] Modal CLI not found. Install with: pip install modal" -ForegroundColor Red exit 1 } Write-Host "[OK] Modal CLI: $modalVersion" -ForegroundColor Green Write-Host "" Set-Location -LiteralPath $RootDir Write-Host "[RUN] Deploying full pipeline to Modal (A100 80GB)..." -ForegroundColor Magenta Write-Host "" $cmd = "modal run modal_project/app.py::run_full_pipeline" Write-Host " > $cmd" -ForegroundColor Gray Write-Host "" Invoke-Expression $cmd if ($LASTEXITCODE -ne 0) { Write-Host "" Write-Host "[FAIL] Pipeline failed. Check logs above." -ForegroundColor Red Write-Host " Common fixes:" -ForegroundColor Yellow Write-Host " 1. Check Modal balance: modal account show" -ForegroundColor Yellow Write-Host " 2. Create HF secret: modal secret create hf-secrets HF_TOKEN=hf_your_token" -ForegroundColor Yellow Write-Host " 3. Verify token has 'Write' permission: https://huggingface.co/settings/tokens" -ForegroundColor Yellow exit 1 } Write-Host "" Write-Host "================================================================" -ForegroundColor Cyan Write-Host " Pipeline complete!" -ForegroundColor Green Write-Host " Results stored in Modal volume: /data/output" -ForegroundColor Green Write-Host " List files: modal volume ls diffusiongemma-volume /data/output" -ForegroundColor Green Write-Host "================================================================" -ForegroundColor Cyan