[2noise/ChatTTS]刚入门,合成语音出现报错

2024-10-17 703 views
5
import ChatTTS
import torch
import torchaudio

chat = ChatTTS.Chat()
chat.load(compile=False) # Set to True for better performance

texts = ["PUT YOUR 1st TEXT HERE", "PUT YOUR 2nd TEXT HERE"]

wavs = chat.infer(texts)

torchaudio.save("output1.wav", torch.from_numpy(wavs[0]), 24000)

以上是代码

以下是报错

AttributeError: partially initialized module 'ChatTTS' has no attribute 'Chat' (most likely due to a circular import)

回答

8

请提供更多信息以帮助定位问题,如:目录结构、运行环境等。