launcher improvements (windows)

+be able to update xtts from update
+user can cancel install for installer.bat/launcher.bat if choice is on accident
+added flags for XTTS --stream-play-sync, --deepspeed
This commit is contained in:
deffcolony
2024-01-04 22:10:58 +01:00
parent 308b9e3724
commit 1202739edd
2 changed files with 45 additions and 36 deletions

View File

@@ -232,7 +232,7 @@ if defined xtts_env_exist (
REM Start XTTS
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% XTTS launched in a new window.
start cmd /k "title XTTSv2 API Server && cd /d %~dp0xtts && python -m xtts_api_server"
start cmd /k "title XTTSv2 API Server && cd /d %~dp0xtts && python -m xtts_api_server --deepspeed --stream-play-sync"
)
)
@@ -346,7 +346,7 @@ if %errorlevel% neq 0 (
call git pull --rebase --autostash
if %errorlevel% neq 0 (
REM incase there is still something wrong
echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] Errors while updating. Please download the latest version manually.%reset%
echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] Errors while updating.%reset%
) else (
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% %green_fg_strong%SillyTavern updated successfully.%reset%
)
@@ -354,28 +354,32 @@ if %errorlevel% neq 0 (
REM Check if SillyTavern-extras directory exists
if not exist "%~dp0SillyTavern-extras" (
echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] SillyTavern-extras directory not found. Skipping extras update.%reset%
echo %yellow_bg%[%time%]%reset% %yellow_fg_strong%[WARN] SillyTavern-extras directory not found. Skipping extras update.%reset%
goto :update_xtts
)
cd /d "%~dp0SillyTavern-extras"
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Updating SillyTavern-extras...
call git pull
if %errorlevel% neq 0 (
REM in case there is still something wrong
echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] Errors while updating.%reset%
) else (
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% %green_fg_strong%SillyTavern-extras updated successfully.%reset%
goto :update_xtts
)
:update_xtts
REM Check if XTTS directory exists
if not exist "%~dp0xtts" (
echo %yellow_bg%[%time%]%reset% %yellow_fg_strong%[WARN] xtts directory not found. Skipping XTTS update.%reset%
pause
goto :home
)
cd /d "%~dp0SillyTavern-extras"
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Updating SillyTavern-extras...
REM Check if git is installed
git --version > nul 2>&1
if %errorlevel% neq 0 (
echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] git command not found in PATH. Skipping update.%reset%
echo %red_bg%Please make sure Git is installed and added to your PATH.%reset%
) else (
call git pull
if %errorlevel% neq 0 (
REM incase there is still something wrong
echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] Errors while updating. Please download the latest version manually.%reset%
) else (
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% %green_fg_strong%SillyTavern-extras updated successfully.%reset%
)
)
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Updating XTTS...
call conda activate xtts
pip install --upgrade xtts-api-server
call conda deactivate
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% %green_fg_strong%XTTS updated successfully.%reset%
pause
goto :home
@@ -955,15 +959,16 @@ if /i "!confirmation!"=="Y" (
rmdir /s /q "%temp%\SillyTavern-extras-TEMP"
endlocal
:what_gpu
cls
echo %blue_fg_strong%SillyTavern Extras%reset%
echo %blue_fg_strong%/ Home / Toolbox / Reinstall Extras%reset%
echo ---------------------------------------------------------------
:what_gpu
echo What is your GPU?
echo 1. NVIDIA
echo 2. AMD
echo 3. None (CPU-only mode)
echo 0. Cancel Reinstall
setlocal enabledelayedexpansion
chcp 65001 > nul
@@ -997,8 +1002,10 @@ if /i "!confirmation!"=="Y" (
) else if "%gpu_choice%"=="3" (
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Using CPU-only mode
goto :reinstall_extras_pre
) else if "%gpu_choice%"=="0" (
goto :toolbox
) else (
echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR]%reset% Invalid GPU choice. Please enter a valid number.
echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] Invalid number. Please enter a valid number.%reset%
pause
goto what_gpu
)

View File

@@ -157,8 +157,7 @@ if "%choice%"=="1" (
) else if "%choice%"=="0" (
exit
) else (
color 6
echo WARNING: Invalid number. Please insert a valid number.
echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] Invalid number. Please enter a valid number.%reset%
pause
goto :installer
)
@@ -171,11 +170,11 @@ echo %blue_fg_strong%/ Installer / SillyTavern + Extras%reset%
echo ---------------------------------------------------------------
REM GPU menu - Frontend
:what_gpu
echo What is your GPU?
echo 1. NVIDIA
echo 2. AMD
echo 3. None (CPU-only mode)
echo 0. Cancel install
setlocal enabledelayedexpansion
chcp 65001 > nul
@@ -210,10 +209,12 @@ if "%gpu_choice%"=="1" (
) else if "%gpu_choice%"=="3" (
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Using CPU-only mode
goto :install_st_extras_pre
) else if "%gpu_choice%"=="0" (
goto :installer
) else (
echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR]%reset% Invalid number. Please enter a valid number.
echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] Invalid number. Please enter a valid number.%reset%
pause
goto what_gpu
goto :install_st_extras
)
:install_st_extras_pre
@@ -270,7 +271,7 @@ if /i "%install_xtts_requirements%"=="Y" (
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Installing pip requirements for xtts...
pip install xtts-api-server
pip install pydub
pip install stream2sentence==0.2.2
pip install stream2sentence
REM Use the GPU choice made earlier to set the correct PyTorch index-url
if "%GPU_CHOICE%"=="1" (
@@ -453,11 +454,11 @@ echo %blue_fg_strong%/ Installer / Extras%reset%
echo ---------------------------------------------------------------
REM GPU menu - Frontend
:what_gpu
echo What is your GPU?
echo 1. NVIDIA
echo 2. AMD
echo 3. None (CPU-only mode)
echo 0. Cancel install
setlocal enabledelayedexpansion
chcp 65001 > nul
@@ -492,10 +493,12 @@ if "%gpu_choice%"=="1" (
) else if "%gpu_choice%"=="3" (
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Using CPU-only mode
goto :install_extras_pre
) else if "%gpu_choice%"=="0" (
goto :installer
) else (
echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR]%reset% Invalid number. Please enter a valid number.
echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] Invalid number. Please enter a valid number.%reset%
pause
goto what_gpu
goto :install_extras
)
:install_extras_pre
@@ -543,7 +546,7 @@ if /i "%install_xtts_requirements%"=="Y" (
echo %blue_bg%[%time%]%reset% %blue_fg_strong%[INFO]%reset% Installing pip requirements for xtts...
pip install xtts-api-server
pip install pydub
pip install stream2sentence==0.2.2
pip install stream2sentence
REM Use the GPU choice made earlier to set the correct PyTorch index-url
if "%GPU_CHOICE%"=="1" (
@@ -699,8 +702,7 @@ if "%support_choice%"=="1" (
) else if "%support_choice%"=="0" (
goto :installer
) else (
color 6
echo WARNING: Invalid number. Please insert a valid number.
echo %red_bg%[%time%]%reset% %red_fg_strong%[ERROR] Invalid number. Please enter a valid number.%reset%
pause
goto :support
)