Add files via upload
This commit is contained in:
1 parent
b21bb0450d
commit
3f844932eb
2 files changed
+12
-25
No files matched your search
@@ -43,12 +43,10 @@ try:
|
|||||||
from TTS.utils.synthesizer import Synthesizer
|
from TTS.utils.synthesizer import Synthesizer
|
||||||
except ModuleNotFoundError:
|
except ModuleNotFoundError:
|
||||||
logger.error(
|
logger.error(
|
||||||
"[params['branding']]\033[91mWarning\033[0m Could not find the TTS module. Make sure to install the requirements for the "
|
f"[{params['branding']}]\033[91mWarning\033[0m Could not find the TTS module. Make sure to install the requirements for the {params['branding']} extension."
|
||||||
+ params["branding"]
|
f"[{params['branding']}]\033[91mWarning\033[0m Linux / Mac:\npip install -r extensions/alltalk_tts/requirements.txt\n"
|
||||||
+ " extension."
|
f"[{params['branding']}]\033[91mWarning\033[0m Windows:\npip install -r extensions\\alltalk_tts\\requirements.txt\n"
|
||||||
"[params['branding']]\033[91mWarning\033[0m Linux / Mac:\npip install -r extensions/alltalk_tts/requirements.txt\n"
|
f"[{params['branding']}]\033[91mWarning\033[0m If you used the one-click installer, paste the command above in the terminal window launched after running the cmd_ script. On Windows, that's cmd_windows.bat."
|
||||||
"[params['branding']]\033[91mWarning\033[0m Windows:\npip install -r extensions\\alltalk_tts\\requirements.txt\n"
|
|
||||||
"[params['branding']]\033[91mWarning\033[0m If you used the one-click installer, paste the command above in the terminal window launched after running the cmd_ script. On Windows, that's cmd_windows.bat."
|
|
||||||
)
|
)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
@@ -78,8 +76,8 @@ def get_available_voices():
|
|||||||
#### LICENSE DISPLAY ####
|
#### LICENSE DISPLAY ####
|
||||||
#########################
|
#########################
|
||||||
# STARTUP Display Licence Information
|
# STARTUP Display Licence Information
|
||||||
print("[" + params["branding"] + "Startup] \033[94mCoqui Public Model License\033[0m")
|
print(f"[{params['branding']}Startup] \033[94mCoqui Public Model License\033[0m")
|
||||||
print("[" + params["branding"] + "Startup] \033[94mhttps://coqui.ai/cpml.txt\033[0m")
|
print(f"[{params['branding']}Startup] \033[94mhttps://coqui.ai/cpml.txt\033[0m")
|
||||||
|
|
||||||
|
|
||||||
############################################
|
############################################
|
||||||
@@ -87,12 +85,7 @@ print("[" + params["branding"] + "Startup] \033[94mhttps://coqui.ai/cpml.txt\033
|
|||||||
############################################
|
############################################
|
||||||
def delete_old_files(folder_path, days_to_keep):
|
def delete_old_files(folder_path, days_to_keep):
|
||||||
current_time = datetime.now()
|
current_time = datetime.now()
|
||||||
print(
|
print(f"[{params['branding']}Startup] Deletion of old output folder WAV files is currently enabled and set at", delete_output_wavs_setting)
|
||||||
"["
|
|
||||||
+ params["branding"]
|
|
||||||
+ "Startup] Deletion of old output folder WAV files is currently enabled and set at",
|
|
||||||
delete_output_wavs_setting,
|
|
||||||
)
|
|
||||||
for file_name in os.listdir(folder_path):
|
for file_name in os.listdir(folder_path):
|
||||||
file_path = os.path.join(folder_path, file_name)
|
file_path = os.path.join(folder_path, file_name)
|
||||||
if os.path.isfile(file_path):
|
if os.path.isfile(file_path):
|
||||||
@@ -254,7 +247,7 @@ while time.time() - start_time < timeout:
|
|||||||
except requests.RequestException as e:
|
except requests.RequestException as e:
|
||||||
# Print the exception for debugging purposes
|
# Print the exception for debugging purposes
|
||||||
print(
|
print(
|
||||||
f"[{params['branding']}Startup] \033[91mWarning\033[0m TTS Subprocess has NOT started up yet, Will keep trying for 60 seconds maximum"
|
f"[{params['branding']}Startup] \033[91mWarning\033[0m TTS Subprocess has NOT started up yet, Will keep trying for 60 seconds maximum. Please wait."
|
||||||
)
|
)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
else:
|
else:
|
||||||
|
|||||||
+4
-10
@@ -101,16 +101,10 @@ try:
|
|||||||
|
|
||||||
deepspeed_installed = True
|
deepspeed_installed = True
|
||||||
print(f"[{params['branding']}Startup] DeepSpeed \033[93mDetected\033[0m")
|
print(f"[{params['branding']}Startup] DeepSpeed \033[93mDetected\033[0m")
|
||||||
print(
|
print(f"[{params['branding']}Startup] Activate DeepSpeed in {params['branding']} settings")
|
||||||
f"[{params['branding']}Startup] Activate DeepSpeed in "
|
|
||||||
+ params["branding"]
|
|
||||||
+ " settings"
|
|
||||||
)
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
deepspeed_installed = False
|
deepspeed_installed = False
|
||||||
print(
|
print(f"[{params['branding']}Startup] DeepSpeed \033[93mNot Detected\033[0m. See https://github.com/microsoft/DeepSpeed")
|
||||||
f"[{params['branding']}Startup] DeepSpeed \033[93mNot Detected\033[0m. See https://github.com/microsoft/DeepSpeed"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@asynccontextmanager
|
@asynccontextmanager
|
||||||
@@ -411,7 +405,7 @@ async def generate_audio(text, voice, language, output_file):
|
|||||||
generate_start_time = time.time() # Record the start time of generating TTS
|
generate_start_time = time.time() # Record the start time of generating TTS
|
||||||
# XTTSv2 LOCAL Method
|
# XTTSv2 LOCAL Method
|
||||||
if params["tts_method_xtts_local"]:
|
if params["tts_method_xtts_local"]:
|
||||||
print("[" + params["branding"] + "TTSGen] {}".format(text))
|
print(f"[{params['branding']}TTSGen] {text}")
|
||||||
gpt_cond_latent, speaker_embedding = model.get_conditioning_latents(
|
gpt_cond_latent, speaker_embedding = model.get_conditioning_latents(
|
||||||
audio_path=[f"{this_dir}/voices/{voice}"]
|
audio_path=[f"{this_dir}/voices/{voice}"]
|
||||||
)
|
)
|
||||||
@@ -427,7 +421,7 @@ async def generate_audio(text, voice, language, output_file):
|
|||||||
# API TTS and API LOCAL Methods
|
# API TTS and API LOCAL Methods
|
||||||
elif params["tts_method_api_tts"] or params["tts_method_api_local"]:
|
elif params["tts_method_api_tts"] or params["tts_method_api_local"]:
|
||||||
# Set the correct output path (different from the if statement)
|
# Set the correct output path (different from the if statement)
|
||||||
print("[" + params["branding"] + "TTSGen] Using API TTS/Local Method")
|
print(f"[{params['branding']}TTSGen] Using API TTS/Local Method")
|
||||||
model.tts_to_file(
|
model.tts_to_file(
|
||||||
text=text,
|
text=text,
|
||||||
file_path=output_file,
|
file_path=output_file,
|
||||||
|
|||||||
Reference in new issue
Block a user