Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cosyvoice1:使用代码执行跨语种复刻时报错 #792

Open
FaderYin opened this issue Dec 26, 2024 · 1 comment
Open

cosyvoice1:使用代码执行跨语种复刻时报错 #792

FaderYin opened this issue Dec 26, 2024 · 1 comment

Comments

@FaderYin
Copy link

FaderYin commented Dec 26, 2024

代码

# 使用的就是提供的示例代码
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
@aluminumbox
Copy link
Collaborator

本地验证了一下并没有发现问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants