teddybear082 commited on
Commit ·
8468e9c
1
Parent(s): cce21a0
Fix .bat and pyinstaller script for newer pocket-tts
Browse files- pyinstaller_command.txt +1 -1
- run_pocket_tts_server_exe.bat +18 -9
pyinstaller_command.txt
CHANGED
|
@@ -12,4 +12,4 @@ pyinstaller --noconfirm --clean --onefile --icon=NONE ^
|
|
| 12 |
--hidden-import "soundfile" ^
|
| 13 |
pocket_tts_openai_server.py
|
| 14 |
|
| 15 |
-
pyinstaller --noconfirm --clean --onefile --icon=
|
|
|
|
| 12 |
--hidden-import "soundfile" ^
|
| 13 |
pocket_tts_openai_server.py
|
| 14 |
|
| 15 |
+
pyinstaller --noconfirm --clean --onefile --icon=pocket-tts-logo.ico --name "PocketTTS-Server" --add-data "utils.py;utils.py" --add-data "static;static" --add-data "templates;templates" --add-data "voices;voices" --add-data "model;model" --collect-all "pocket_tts" --hidden-import "engineio.async_drivers.threading" --hidden-import "flask" --hidden-import "torch" --hidden-import "torchaudio" --hidden-import "soundfile" pocket_tts_openai_server.py
|
run_pocket_tts_server_exe.bat
CHANGED
|
@@ -10,6 +10,9 @@ echo (Standalone EXE)
|
|
| 10 |
echo ========================================================
|
| 11 |
echo.
|
| 12 |
|
|
|
|
|
|
|
|
|
|
| 13 |
:: 0. Hugging Face Authentication
|
| 14 |
set "HF_TOKEN=your_token_here_if_you_want_to_hardcode_it"
|
| 15 |
if "%HF_TOKEN%"=="your_token_here_if_you_want_to_hardcode_it" (
|
|
@@ -36,12 +39,19 @@ set /p "INPUT_PORT=Port [%PORT%]: "
|
|
| 36 |
if not "%INPUT_PORT%"=="" set "PORT=%INPUT_PORT%"
|
| 37 |
|
| 38 |
:: 3. Model Path
|
|
|
|
|
|
|
| 39 |
set "MODEL_PATH="
|
| 40 |
-
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
:: 4. Voices Directory
|
| 44 |
-
:: Changed: Now remains empty if the user hits ENTER.
|
| 45 |
set "VOICES_DIR="
|
| 46 |
set /p "INPUT_VOICES=Voices Directory (Optional, leave blank to skip): "
|
| 47 |
|
|
@@ -50,7 +60,6 @@ if not "%INPUT_VOICES%"=="" (
|
|
| 50 |
)
|
| 51 |
|
| 52 |
:: 5. Streaming Default
|
| 53 |
-
:: Changed: Defaults to ON. Only unsets if the user types 'N'.
|
| 54 |
set "STREAM_ARG=--stream"
|
| 55 |
set /p "INPUT_STREAM=Enable Streaming? (Y/N) [Y]: "
|
| 56 |
if /i "%INPUT_STREAM%"=="N" set "STREAM_ARG="
|
|
@@ -60,22 +69,22 @@ echo ========================================================
|
|
| 60 |
echo Starting Pocket TTS Server (EXE)...
|
| 61 |
echo Host: %HOST%
|
| 62 |
echo Port: %PORT%
|
| 63 |
-
|
| 64 |
if defined VOICES_DIR (echo Voices: %VOICES_DIR%) else (echo Voices: Default/None)
|
| 65 |
if defined STREAM_ARG (echo Streaming: Enabled) else (echo Streaming: Disabled)
|
| 66 |
echo ========================================================
|
| 67 |
echo.
|
| 68 |
|
| 69 |
:: 6. Run Command
|
| 70 |
-
if exist "%
|
| 71 |
-
"%
|
| 72 |
) else (
|
| 73 |
echo [ERROR] PocketTTS-Server.exe not found in the current directory.
|
| 74 |
-
echo Please make sure the executable is located in: %
|
| 75 |
)
|
| 76 |
|
| 77 |
if %ERRORLEVEL% NEQ 0 (
|
| 78 |
echo.
|
| 79 |
echo [ERROR] Server exited with error code %ERRORLEVEL%.
|
| 80 |
pause
|
| 81 |
-
)
|
|
|
|
| 10 |
echo ========================================================
|
| 11 |
echo.
|
| 12 |
|
| 13 |
+
:: Base directory of this BAT file
|
| 14 |
+
set "BASE_DIR=%~dp0"
|
| 15 |
+
|
| 16 |
:: 0. Hugging Face Authentication
|
| 17 |
set "HF_TOKEN=your_token_here_if_you_want_to_hardcode_it"
|
| 18 |
if "%HF_TOKEN%"=="your_token_here_if_you_want_to_hardcode_it" (
|
|
|
|
| 39 |
if not "%INPUT_PORT%"=="" set "PORT=%INPUT_PORT%"
|
| 40 |
|
| 41 |
:: 3. Model Path
|
| 42 |
+
:: Default to models\b6369a24.yaml relative to this BAT file
|
| 43 |
+
set "DEFAULT_MODEL=%BASE_DIR%model\b6369a24.yaml"
|
| 44 |
set "MODEL_PATH="
|
| 45 |
+
|
| 46 |
+
set /p "INPUT_MODEL=Model Path/Variant (Optional, default=model\b6369a24.yaml): "
|
| 47 |
+
|
| 48 |
+
if "%INPUT_MODEL%"=="" (
|
| 49 |
+
set "MODEL_PATH=--model_path ^"%DEFAULT_MODEL%^""
|
| 50 |
+
) else (
|
| 51 |
+
set "MODEL_PATH=--model_path ^"%INPUT_MODEL%^""
|
| 52 |
+
)
|
| 53 |
|
| 54 |
:: 4. Voices Directory
|
|
|
|
| 55 |
set "VOICES_DIR="
|
| 56 |
set /p "INPUT_VOICES=Voices Directory (Optional, leave blank to skip): "
|
| 57 |
|
|
|
|
| 60 |
)
|
| 61 |
|
| 62 |
:: 5. Streaming Default
|
|
|
|
| 63 |
set "STREAM_ARG=--stream"
|
| 64 |
set /p "INPUT_STREAM=Enable Streaming? (Y/N) [Y]: "
|
| 65 |
if /i "%INPUT_STREAM%"=="N" set "STREAM_ARG="
|
|
|
|
| 69 |
echo Starting Pocket TTS Server (EXE)...
|
| 70 |
echo Host: %HOST%
|
| 71 |
echo Port: %PORT%
|
| 72 |
+
echo Model: %MODEL_PATH%
|
| 73 |
if defined VOICES_DIR (echo Voices: %VOICES_DIR%) else (echo Voices: Default/None)
|
| 74 |
if defined STREAM_ARG (echo Streaming: Enabled) else (echo Streaming: Disabled)
|
| 75 |
echo ========================================================
|
| 76 |
echo.
|
| 77 |
|
| 78 |
:: 6. Run Command
|
| 79 |
+
if exist "%BASE_DIR%PocketTTS-Server.exe" (
|
| 80 |
+
"%BASE_DIR%PocketTTS-Server.exe" --host %HOST% --port %PORT% %MODEL_PATH% %VOICES_DIR% %STREAM_ARG%
|
| 81 |
) else (
|
| 82 |
echo [ERROR] PocketTTS-Server.exe not found in the current directory.
|
| 83 |
+
echo Please make sure the executable is located in: %BASE_DIR%
|
| 84 |
)
|
| 85 |
|
| 86 |
if %ERRORLEVEL% NEQ 0 (
|
| 87 |
echo.
|
| 88 |
echo [ERROR] Server exited with error code %ERRORLEVEL%.
|
| 89 |
pause
|
| 90 |
+
)
|