Spaces:
Running
Running
import TTS.api | |
import TTS.utils.manage as manage | |
import config | |
# 定义一个函数来自动接受许可条款 | |
def ask_tos_patch(self, output_path): | |
print("Automatically accepting the terms of service.") | |
return True | |
# 使用我们定义的函数替换原有的 ask_tos 方法 | |
manage.ModelManager.ask_tos = ask_tos_patch | |
# 初始化 TTS 实例并下载模型 | |
tts = TTS.api.TTS() | |
for id, model in config.models.items(): | |
tts.download_model_by_name(model) | |