forked from teddybear082/WingmanAI-Coqui-TTS-Openai-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_server_with_python.bat
More file actions
86 lines (77 loc) · 2.46 KB
/
run_server_with_python.bat
File metadata and controls
86 lines (77 loc) · 2.46 KB
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
@echo off
setlocal enabledelayedexpansion
echo Welcome to the Openai-Compatible Server for Coqui-TTS!
echo .
:: Prompt for language
echo Select a language:
echo 1. English (en)
echo 2. Spanish (es)
echo 3. French (fr)
echo 4. German (de)
echo 5. Italian (it)
echo 6. Portuguese (pt)
echo 7. Polish (pl)
echo 8. Turkish (tr)
echo 9. Russian (ru)
echo 10. Dutch (nl)
echo 11. Czech (cs)
echo 12. Arabic (ar)
echo 13. Chinese (zh-cn)
echo 14. Japanese (ja)
echo 15. Hungarian (hu)
echo 16. Korean (ko)
echo 17. Hindi (hi)
set /p lang_choice="Input the number for your language choice and press enter: "
:: Map language choice to code
set "language_id="
if "%lang_choice%"=="1" set language_id=en
if "%lang_choice%"=="2" set language_id=es
if "%lang_choice%"=="3" set language_id=fr
if "%lang_choice%"=="4" set language_id=de
if "%lang_choice%"=="5" set language_id=it
if "%lang_choice%"=="6" set language_id=pt
if "%lang_choice%"=="7" set language_id=pl
if "%lang_choice%"=="8" set language_id=tr
if "%lang_choice%"=="9" set language_id=ru
if "%lang_choice%"=="10" set language_id=nl
if "%lang_choice%"=="11" set language_id=cs
if "%lang_choice%"=="12" set language_id=ar
if "%lang_choice%"=="13" set language_id=zh-cn
if "%lang_choice%"=="14" set language_id=ja
if "%lang_choice%"=="15" set language_id=hu
if "%lang_choice%"=="16" set language_id=ko
if "%lang_choice%"=="17" set language_id=hi
if "%language_id%"=="" (
echo Invalid language selection.
goto :eof
)
:: Prompt for hardware
echo.
set /p gpu_choice="Run with GPU or CPU? (type 'gpu' or 'cpu' and press enter): "
:: Prompt for streaming
echo.
set /p stream_choice="Enable streaming mode? (Y/N): "
set "stream_flag="
if /i "%stream_choice%"=="y" (
set "stream_flag=--stream"
)
:: Base arguments
set "args_common=--model_path xtts_model\main --config_path xtts_model\main\config.json --speakers_file_path xtts_model\main\speakers.json --language_idx %language_id% !stream_flag!"
set "args="
if /i "%gpu_choice%"=="gpu" (
set "args=--use_cuda --lowvram !args_common!"
) else if /i "%gpu_choice%"=="cpu" (
set "args=!args_common!"
) else (
echo Invalid choice. Please type 'gpu' or 'cpu'.
goto :eof
)
:: Activate virtual environment
call "%~dp0venv\Scripts\activate.bat"
:: Run the server in the current terminal
echo.
echo Starting the TTS server...
echo Access a test webpage by CTRL clicking this link after it loads: http://localhost:5002
echo.
:: Run the Python server
python server-with-low-vram-and-stream.py !args!