| $ErrorActionPreference = "Stop" | |
| $root = Split-Path -Parent $PSScriptRoot | |
| Set-Location $root | |
| $python = Join-Path $root ".runtime-venv\Scripts\python.exe" | |
| if (-not (Test-Path $python)) { | |
| $python = Join-Path $root ".venv\Scripts\python.exe" | |
| } | |
| if (-not (Test-Path $python)) { | |
| throw "Python runtime was not found. Expected .runtime-venv or .venv." | |
| } | |
| if (-not $env:GRADIO_SERVER_NAME) { | |
| $env:GRADIO_SERVER_NAME = "127.0.0.1" | |
| } | |
| if (-not $env:GRADIO_SERVER_PORT) { | |
| $env:GRADIO_SERVER_PORT = "7860" | |
| } | |
| & $python (Join-Path $root "app.py") | |