teddybear082 commited on
Commit ·
e5bb4ba
1
Parent(s): 30e8822
various fixes
Browse files-update to latest PR for pocket-tts to support local model loading
-fixes for .bat files when running with custom voices directory
- pyinstaller_command.txt +1 -1
- run_pocket_tts_server.bat +4 -6
- run_pocket_tts_server_exe.bat +11 -20
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=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" --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
|
|
|
|
| 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 "model;model" --add-data "templates;templates" --add-data "voices;voices" --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.bat
CHANGED
|
@@ -50,12 +50,10 @@ if not "%INPUT_MODEL%"=="" set "MODEL_PATH=--model_path ^"%INPUT_MODEL%^""
|
|
| 50 |
set "DEFAULT_VOICES=%~dp0voices"
|
| 51 |
set /p "INPUT_VOICES=Voices Directory [%DEFAULT_VOICES%]: "
|
| 52 |
|
| 53 |
-
if "
|
| 54 |
-
|
| 55 |
-
set "VOICES_DIR=--voices_dir ^"!DEFAULT_VOICES!^""
|
| 56 |
) else (
|
| 57 |
-
|
| 58 |
-
set "VOICES_DIR=--voices_dir ^"%INPUT_VOICES%^""
|
| 59 |
)
|
| 60 |
|
| 61 |
:: 6. Streaming Default
|
|
@@ -76,7 +74,7 @@ echo ========================================================
|
|
| 76 |
echo.
|
| 77 |
|
| 78 |
:: 7. Run Command
|
| 79 |
-
python pocket_tts_openai_server.py --host %HOST% --port %PORT% %MODEL_PATH% %
|
| 80 |
|
| 81 |
if %ERRORLEVEL% NEQ 0 (
|
| 82 |
echo.
|
|
|
|
| 50 |
set "DEFAULT_VOICES=%~dp0voices"
|
| 51 |
set /p "INPUT_VOICES=Voices Directory [%DEFAULT_VOICES%]: "
|
| 52 |
|
| 53 |
+
if "!INPUT_VOICES!"=="" (
|
| 54 |
+
set "VOICES_DIR_ARG=--voices_dir "!DEFAULT_VOICES!""
|
|
|
|
| 55 |
) else (
|
| 56 |
+
set "VOICES_DIR_ARG=--voices_dir "!INPUT_VOICES!""
|
|
|
|
| 57 |
)
|
| 58 |
|
| 59 |
:: 6. Streaming Default
|
|
|
|
| 74 |
echo.
|
| 75 |
|
| 76 |
:: 7. Run Command
|
| 77 |
+
python pocket_tts_openai_server.py --host %HOST% --port %PORT% %MODEL_PATH% %VOICES_DIR_ARG% %STREAM_ARG%
|
| 78 |
|
| 79 |
if %ERRORLEVEL% NEQ 0 (
|
| 80 |
echo.
|
run_pocket_tts_server_exe.bat
CHANGED
|
@@ -10,9 +10,6 @@ echo (Standalone EXE)
|
|
| 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,27 +36,21 @@ set /p "INPUT_PORT=Port [%PORT%]: "
|
|
| 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 |
-
|
| 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 |
|
| 58 |
-
if not "
|
| 59 |
-
set "VOICES_DIR=--voices_dir
|
| 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,22 +60,22 @@ echo ========================================================
|
|
| 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 "%
|
| 80 |
-
"%
|
| 81 |
) else (
|
| 82 |
echo [ERROR] PocketTTS-Server.exe not found in the current directory.
|
| 83 |
-
echo Please make sure the executable is located in: %
|
| 84 |
)
|
| 85 |
|
| 86 |
if %ERRORLEVEL% NEQ 0 (
|
| 87 |
echo.
|
| 88 |
echo [ERROR] Server exited with error code %ERRORLEVEL%.
|
| 89 |
pause
|
| 90 |
-
)
|
|
|
|
| 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 |
if not "%INPUT_PORT%"=="" set "PORT=%INPUT_PORT%"
|
| 37 |
|
| 38 |
:: 3. Model Path
|
|
|
|
|
|
|
| 39 |
set "MODEL_PATH="
|
| 40 |
+
set /p "INPUT_MODEL=Model Path/Variant (Optional, default=built-in): "
|
| 41 |
+
if not "%INPUT_MODEL%"=="" set "MODEL_PATH=--model_path ^"%INPUT_MODEL%^""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
|
| 48 |
+
if not "!INPUT_VOICES!"=="" (
|
| 49 |
+
set "VOICES_DIR=--voices_dir "!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 |
echo Starting Pocket TTS Server (EXE)...
|
| 61 |
echo Host: %HOST%
|
| 62 |
echo Port: %PORT%
|
| 63 |
+
if defined MODEL_PATH echo Model: %MODEL_PATH%
|
| 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 "%~dp0PocketTTS-Server.exe" (
|
| 71 |
+
"%~dp0PocketTTS-Server.exe" --host %HOST% --port %PORT% %MODEL_PATH% %VOICES_DIR% %STREAM_ARG%
|
| 72 |
) else (
|
| 73 |
echo [ERROR] PocketTTS-Server.exe not found in the current directory.
|
| 74 |
+
echo Please make sure the executable is located in: %~dp0
|
| 75 |
)
|
| 76 |
|
| 77 |
if %ERRORLEVEL% NEQ 0 (
|
| 78 |
echo.
|
| 79 |
echo [ERROR] Server exited with error code %ERRORLEVEL%.
|
| 80 |
pause
|
| 81 |
+
)
|