File size: 508 Bytes
4fcca49
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
param([Parameter(Mandatory=$true)][string]$Process, [ValidateSet(4,8,16)][int]$Steps=4)
$ErrorActionPreference="Stop"
$Root=Split-Path -Parent $PSScriptRoot
$Py=Join-Path $Root ".venv\Scripts\python.exe"
$Server=Start-Process -FilePath $Py -ArgumentList @("scripts\serve_onnx.py","--steps",$Steps) -WorkingDirectory $Root -PassThru
try {
  Start-Sleep -Seconds 3
  & $Py ".vendor\NitroGen\scripts\play.py" --process $Process
} finally {
  if (-not $Server.HasExited) { Stop-Process -Id $Server.Id -Force }
}