LeeAeron commited on
Commit
c4eb107
·
verified ·
1 Parent(s): 984b45f

Upload 2 files

Browse files
CBTTSSRVSR_UPDATE.7z ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a9b5b5355af432409d60776aa086f99cd17b82b0bf6e9092b943b1eff1c9e51d
3
+ size 77515
Chatterbox.TTS.Server.Multilingual.Portable.by.LeeAeron.bat ADDED
@@ -0,0 +1,187 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @echo off
2
+ setlocal enabledelayedexpansion
3
+
4
+ set "PYTHON_DIR=%~dp0ChatterBox\venv"
5
+ set "PS_EXE=%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe"
6
+
7
+ :main_menu
8
+ cls
9
+ echo ========================================================
10
+ echo Chatterbox-TTS-Server-Multilingual Main Menu
11
+ echo ========================================================
12
+ echo 1. Start Chatterbox-TTS-Server-Multilingual
13
+ echo 2. Install/Reinstall Chatterbox-TTS-Server-Multilingual
14
+ echo 3. Update Chatterbox-TTS-Server-Multilingual
15
+ echo ========================================================
16
+ echo By @li_aeron 2025
17
+ echo ========================================================
18
+ set /p choice=Choose action 1-3:
19
+ if "%choice%"=="1" goto start_chatterbox
20
+ if "%choice%"=="2" goto install_chatterbox
21
+ if "%choice%"=="3" goto update_chatterbox
22
+ echo Wrong choice. Please, try again.
23
+ pause
24
+ goto main_menu
25
+
26
+ :install_chatterbox
27
+ cls
28
+ echo ==========================================================
29
+ echo Preparing installation...
30
+ echo ==========================================================
31
+
32
+ set "CACHE_DIR=%~dp0ChatterBox\.cache"
33
+ set "INSTALL_DIR=%~dp0ChatterBox"
34
+ set "SEVENZIP_EXE=%CACHE_DIR%\7zr.exe"
35
+ set "ARCHIVE_FILE=%CACHE_DIR%\CBTTSSRVSR.7z"
36
+ set "SEVENZIP_URL=https://huggingface.co/datasets/LeeAeron/ffmpeg_for_ai/resolve/main/7zr.exe?download=true"
37
+ set "ARCHIVE_URL=https://huggingface.co/datasets/LeeAeron/Chatterbox-TTS-Server-Multilingual/resolve/main/CBTTSSRVSR.7z?download=true"
38
+
39
+ if exist "%INSTALL_DIR%" (
40
+ echo ==========================================================
41
+ echo Previous installation detected in "%INSTALL_DIR%"
42
+ echo ==========================================================
43
+ choice /M "Do you want to remove the existing installation?"
44
+ if errorlevel 2 (
45
+ echo Keeping existing installation. Returning to main menu...
46
+ pause
47
+ goto main_menu
48
+ )
49
+ echo Removing previous installation except "model_cache"...
50
+
51
+ for /d %%D in ("%INSTALL_DIR%\*") do (
52
+ if /I not "%%~nxD"=="model_cache" (
53
+ rmdir /s /q "%%D"
54
+ )
55
+ )
56
+
57
+ del /q "%INSTALL_DIR%\*"
58
+ )
59
+
60
+ mkdir "%INSTALL_DIR%"
61
+
62
+ if not exist "%CACHE_DIR%" mkdir "%CACHE_DIR%"
63
+
64
+ if not exist "%SEVENZIP_EXE%" (
65
+ echo Downloading 7-Zip extractor...
66
+ "%PS_EXE%" -NoProfile -Command "Invoke-WebRequest -Uri '%SEVENZIP_URL%' -OutFile '%SEVENZIP_EXE%'"
67
+ )
68
+
69
+ if not exist "%ARCHIVE_FILE%" (
70
+ echo Downloading Chatterbox installer archive...
71
+ "%PS_EXE%" -NoProfile -Command "Invoke-WebRequest -Uri '%ARCHIVE_URL%' -OutFile '%ARCHIVE_FILE%'"
72
+ )
73
+
74
+ echo Extracting archive...
75
+ "%SEVENZIP_EXE%" x "%ARCHIVE_FILE%" -o"%INSTALL_DIR%" -y
76
+
77
+ set "PSFILE=%INSTALL_DIR%\install\setup.ps1"
78
+ if not exist "%PSFILE%" (
79
+ echo ERROR: setup.ps1 not found at %PSFILE%
80
+ echo Listing contents of %INSTALL_DIR% for debugging:
81
+ dir /b /s "%INSTALL_DIR%"
82
+ pause
83
+ goto main_menu
84
+ )
85
+
86
+ pushd "%~dp0ChatterBox"
87
+
88
+ echo ==========================================================
89
+ echo Launching Installation
90
+ echo ==========================================================
91
+ "%PS_EXE%" -NoProfile -ExecutionPolicy Bypass -Command "Set-Location '%~dp0ChatterBox'; & '%~dp0ChatterBox\install\setup.ps1'"
92
+ set "ERR=%ERRORLEVEL%"
93
+
94
+ popd
95
+
96
+ "%PS_EXE%" -NoProfile -ExecutionPolicy Bypass -File "%PSFILE%"
97
+ set "ERR=%ERRORLEVEL%"
98
+
99
+ if "%ERR%"=="99" goto main_menu
100
+ if "%ERR%"=="1" (
101
+ echo ==========================================================
102
+ echo An error occurred during installation.
103
+ echo Please check the messages above for more details.
104
+ echo ==========================================================
105
+ pause
106
+ goto main_menu
107
+ )
108
+
109
+ echo Installation completed successfully!
110
+ pause
111
+ goto main_menu
112
+
113
+ :update_chatterbox
114
+ cls
115
+ echo ==========================================================
116
+ echo Updating installation...
117
+ echo ==========================================================
118
+
119
+ set "CACHE_DIR=%~dp0ChatterBox\.cache"
120
+ set "INSTALL_DIR=%~dp0ChatterBox"
121
+ set "SEVENZIP_EXE=%CACHE_DIR%\7zr.exe"
122
+ set "UPDATE_ARCHIVE=%CACHE_DIR%\CBTTSSRVSR_UPDATE.7z"
123
+ set "UPDATE_URL=https://huggingface.co/datasets/LeeAeron/Chatterbox-TTS-Server-Multilingual/resolve/main/CBTTSSRVSR_UPDATE.7z?download=true"
124
+
125
+ if not exist "%CACHE_DIR%" mkdir "%CACHE_DIR%"
126
+
127
+ if not exist "%SEVENZIP_EXE%" (
128
+ echo Downloading 7-Zip extractor...
129
+ "%PS_EXE%" -NoProfile -Command "Invoke-WebRequest -Uri 'https://huggingface.co/datasets/LeeAeron/ffmpeg_for_ai/resolve/main/7zr.exe?download=true' -OutFile '%SEVENZIP_EXE%'"
130
+ )
131
+
132
+ echo Downloading update archive...
133
+ "%PS_EXE%" -NoProfile -Command "Invoke-WebRequest -Uri '%UPDATE_URL%' -OutFile '%UPDATE_ARCHIVE%'"
134
+
135
+ echo Extracting update archive...
136
+ "%SEVENZIP_EXE%" x "%UPDATE_ARCHIVE%" -o"%INSTALL_DIR%" -y
137
+
138
+ set "UPDATE_SCRIPT=%INSTALL_DIR%\install\update_ruaccent.ps1"
139
+ if exist "%UPDATE_SCRIPT%" (
140
+ echo Running update script...
141
+ "%PS_EXE%" -NoProfile -ExecutionPolicy Bypass -File "%UPDATE_SCRIPT%"
142
+ set "ERR=%ERRORLEVEL%"
143
+ >nul set /p "= " <nul
144
+ if "%ERR%"=="0" (
145
+ echo Update script executed successfully.
146
+ del /q "%UPDATE_SCRIPT%"
147
+ ) else (
148
+ echo Update script failed with error %ERR%.
149
+ )
150
+ ) else (
151
+ echo No update script found in archive.
152
+ )
153
+
154
+ if exist "%UPDATE_ARCHIVE%" del /q "%UPDATE_ARCHIVE%"
155
+
156
+ echo Update completed!
157
+ pause
158
+ goto main_menu
159
+
160
+ :start_chatterbox
161
+ if not exist "%~dp0ChatterBox\venv\pyvenv.cfg" (
162
+ echo Chatterbox-TTS-Server-Multilingual not installed. Going to installation menu...
163
+ goto install_chatterbox
164
+ )
165
+
166
+ cls
167
+ set "HF_HOME=%~dp0ChatterBox\model_cache\huggingface"
168
+ set "XDG_CACHE_HOME=%~dp0ChatterBox\model_cache"
169
+ set "HF_DATASETS_CACHE=%~dp0ChatterBox\model_cache\huggingface\datasets"
170
+ set "RUACCENT_CACHE_DIR=%CD%\model_cache\ruaccent"
171
+ set "PATH=%~dp0ChatterBox\ffmpeg\bin;%PATH%"
172
+
173
+ TITLE Chatterbox-TTS-Server-Multilingual
174
+
175
+ pushd "%~dp0ChatterBox"
176
+ echo Starting the Chatterbox-TTS-Server...
177
+ call ".\venv\Scripts\activate"
178
+
179
+ echo Virtual environment activated. Starting server...
180
+ echo To stop the server, press CTRL+C in this window.
181
+ echo.
182
+
183
+ python ".\server.py"
184
+ popd
185
+
186
+ echo Chatterbox-TTS-Server has been stopped.
187
+ pause