forked from svc-develop-team/so-vits-svc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-webui.ps1
56 lines (47 loc) · 1.23 KB
/
run-webui.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
function Get-CallPosition
{
$caller = $( Get-PSCallStack )[2]
$functionName = $caller.FunctionName
$lineNumber = $caller.Position.StartLineNumber
return @{
FunctionName = $functionName
LineNumber = $lineNumber
}
}
function Write-LogMessage
{
param (
[string]$Msg
)
$callPosition = Get-CallPosition
$time = Get-Date -Format "yyyy-MM-dd HH:mm:ss.fff"
Write-Host $time -ForegroundColor Green -NoNewline
Write-Host " | " -NoNewline
Write-Host " INFO " -ForegroundColor White -NoNewline
Write-Host " | " -NoNewline
Write-Host $callPosition.FunctionName -ForegroundColor Cyan -NoNewline
Write-Host ":" -ForegroundColor Cyan -NoNewline
Write-Host $callPosition.LineNumber -ForegroundColor Cyan -NoNewline
Write-Host " - " -NoNewline
Write-Host $Msg -ForegroundColor White
}
function Exit-WithPause
{
param (
[Int16]$ExitCode
)
Pause
exit $ExitCode
}
function Main
{
if (-not $env:VIRTUAL_ENV)
{
Write-LogMessage "Please run the script in venv."
Exit-WithPause 1
}
$env:HIP_VISIBLE_DEVICES = "0"
$env:ZLUDA_COMGR_LOG_LEVEL = "1"
& ".\zluda\zluda.exe" -- ".venv\Scripts\python.exe" "webUI.py"
}
Main