sage/coquitts/load_model.py
2025-07-16 14:28:41 +08:00

16 lines
379 B
Python

from apppublic.worker import awaitify
from coquitts.coqui import CoquiTTS
g = ServerEnv()
# e = CoquiTTS('tts_models/en/ljspeech/vits--neon')
# g.en_tts = e
e = CoquiTTS('tts_models/zh-CN/baker/tacotron2-DDC-GST')
g.cn_tts = e
if __name__ == '__main__':
import asyncio
b = await e.generate('你好吗?我很好。')
with open('w.wav','wb') as f:
f.write(b)