forked from prophesier/diff-svc
-
Notifications
You must be signed in to change notification settings - Fork 19
/
inference.bat
95 lines (84 loc) · 1.7 KB
/
inference.bat
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
title Infer Diff-SVC
SETLOCAL ENABLEDELAYEDEXPANSION
REM ================================
REM root 는 anaconda3의 설치 경로를 입력해줍니다
REM ================================
set root=C:\ProgramData\anaconda3
set dpath=I:\_Diff-svc
REM ================================
REM dpath 는 Diff-svc의 설치 경로를 입력해줍니다
REM ================================
set cpath=%dpath%\checkpoints\
set "ccnt=0"
set "acnt=0"
sef df0=
set df1=0102_xiaoma_pe
set df2=0109_hifigan_bigpopcs_hop128
set df3=hubert
set df4=nsf_hifigan
echo off
cls
cd /d %dpath%
for /f "tokens=*" %%d in ('dir %cpath% /B /a:d') DO (
if %df1% == %%d (
REM echo df1 : %%d
) else (
if %df2% == %%d (
REM echo df2 : %%d
) else (
if %df3% == %%d (
REM echo df3 : %%d
) else (
if %df4% == %%d (
REM echo df4 : %%d
) else (
REM echo %%d
set df[!ccnt!]=%%d
set /a ccnt+=1
)))))
:arrayLoop
if defined df[%acnt%] (
set /a "acnt+=1"
GOTO :arrayLoop
)
if "%ccnt%" GTR "1" ( set /a "acnt-=1" )
:selectLoop
cls
if %ccnt% == 0 ( goto :notrain )
if %ccnt% == 1 (
set df0=%df[0]%
goto :Cok
) else (
for /l %%n in (0,1,!acnt!) do (
echo %%n : !df[%%n]!
)
)
REM echo %acnt%
echo.
set /p UST= 추론 할 모델명을 선택해주세요. (숫자만 입력) :
for /L %%a in (0,1,!acnt!) do (
if "%UST%" == "%%a" (
set df0=!df[%%a]!
goto :Cok
)
)
REM echo f : %UST%
goto :selectLoop
:notrain
endlocal
rundll32 user32.dll,MessageBeep
echo 학습된 CKPT 파일이 checkpoints 폴더에 존재하지 않습니다
pause
exit
:Cok
REM echo %df0%
cls
call %root%\Scripts\activate.bat %root%
call cd /d %dpath%
call conda activate diff-svc
call set PYTHONPATH=.
call set CUDA_VISIBLE_DEVICES=0
call python infer_for_bat.py "%df0%"
endlocal
rundll32 user32.dll,MessageBeep
exit