virtual-characters / scripts /run_gradio_server.ps1
ShadowInk's picture
Upload complete Space runtime files
6bcddd0 verified
Raw
History Blame Contribute Delete
1.09 kB
param(
[int]$Port = 7864,
[string]$ServerName = "127.0.0.1",
[string]$VllmUrl = "https://veronicaulises0--virtual-characters-vllm-gemma-serve.modal.run",
[string]$TtsUrl = "https://veronicaulises0--virtual-characters-tts-charactertts-tts.modal.run",
[string]$Stdout,
[string]$Stderr,
[switch]$Mock
)
$ErrorActionPreference = "Stop"
$repoRoot = Split-Path -Parent $PSScriptRoot
$python = Join-Path $repoRoot ".venv\Scripts\python.exe"
if (-not (Test-Path $python)) {
$python = "python"
}
$env:VC_GRADIO_PORT = "$Port"
$env:VC_GRADIO_SERVER_NAME = $ServerName
$env:VC_MODAL_VLLM_URL = $VllmUrl
if ($TtsUrl) {
$env:VC_MODAL_TTS_URL = $TtsUrl
} else {
Remove-Item Env:\VC_MODAL_TTS_URL -ErrorAction SilentlyContinue
}
$env:PYTHONIOENCODING = "utf-8"
$env:PYTHONUTF8 = "1"
$env:PYTHONDONTWRITEBYTECODE = "1"
if ($Mock) {
$env:VC_USE_MOCK = "1"
} else {
Remove-Item Env:\VC_USE_MOCK -ErrorAction SilentlyContinue
}
Remove-Item Env:\VC_MODAL_LLM_URL -ErrorAction SilentlyContinue
Set-Location $repoRoot
& $python -B app.py 1>> $Stdout 2>> $Stderr