File size: 468 Bytes
5ca847f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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)