Update lollms_xtts.py

This commit is contained in:
Saifeddine ALOUI 2024-06-03 16:10:39 +02:00 committed by GitHub
parent 5e7624c489
commit 33e00ead57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -172,6 +172,10 @@ class LollmsXTTS(LollmsTTS):
return LollmsXTTS return LollmsXTTS
def run_xtts_api_server(self): def run_xtts_api_server(self):
root_dir = self.app.lollms_paths.personal_path
shared_folder = root_dir/"shared"
xtts_path = shared_folder / "xtts"
# Get the path to the current Python interpreter # Get the path to the current Python interpreter
ASCIIColors.yellow("Loading XTTS ") ASCIIColors.yellow("Loading XTTS ")
options= "" options= ""
@ -179,7 +183,7 @@ class LollmsXTTS(LollmsTTS):
options += " --deepspeed" options += " --deepspeed"
if self.use_streaming_mode: if self.use_streaming_mode:
options += " --streaming-mode --streaming-mode-improve --stream-play-sync" options += " --streaming-mode --streaming-mode-improve --stream-play-sync"
process = run_python_script_in_env("xtts", f"-m xtts_api_server {options} -o {self.output_folder} -sf {self.voice_samples_path} -p {self.xtts_base_url.split(':')[-1].replace('/','')}", wait= False) process = run_python_script_in_env("xtts", f"-m xtts_api_server {options} -o {self.output_folder} -sf {self.voice_samples_path} -p {self.xtts_base_url.split(':')[-1].replace('/','')}", cwd=xtts_path, wait= False)
return process return process
def wait_for_service_in_another_thread(self, max_retries=150, show_warning=True): def wait_for_service_in_another_thread(self, max_retries=150, show_warning=True):