You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 使用的就是提供的示例代码
cosyvoice = CosyVoice('pretrained_models/CosyVoice-300M') # or change to
# cross_lingual usage
prompt_speech_16k = load_wav('cross_lingual_prompt.wav', 16000)
for i, j in enumerate(cosyvoice.inference_cross_lingual('<|en|>And then later on, fully acquiring that company. So keeping management in line, interest in line with the asset that\'s coming into the family is a reason why sometimes we don\'t buy the whole thing.', prompt_speech_16k)):
waveform = torch.tensor(j['tts_speech']) if not isinstance(j['tts_speech'], torch.Tensor) else j['tts_speech']
torchaudio.save('cross_lingual_{}.wav'.format(i), waveform, cosyvoice.sample_rate)
报错
发生异常: TypeError
string indices must be integers
File "D:\Project\github\TTS\cosyvoice\CosyVoice\demo2.py", line 20, in <module>
waveform = torch.tensor(j['tts_speech']) if not isinstance(j['tts_speech'], torch.Tensor) else j['tts_speech']
TypeError: string indices must be integers
The text was updated successfully, but these errors were encountered:
代码
报错
The text was updated successfully, but these errors were encountered: