Skip to content

Commit

Permalink
Merge pull request #745 from garywill/patch-2
Browse files Browse the repository at this point in the history
Rename misspelled list_avaliable_spks() to list_available_spks()
  • Loading branch information
aluminumbox authored Dec 29, 2024
2 parents 877cf1c + bd4be3f commit 0f6ff29
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ for i, j in enumerate(cosyvoice.inference_instruct2('收到好友从远方寄来
```python
cosyvoice = CosyVoice('pretrained_models/CosyVoice-300M-SFT', load_jit=True, load_onnx=False, fp16=True)
# sft usage
print(cosyvoice.list_avaliable_spks())
print(cosyvoice.list_available_spks())
# change stream=True for chunk stream inference
for i, j in enumerate(cosyvoice.inference_sft('你好,我是通义生成式语音大模型,请问有什么可以帮您的吗?', '中文女', stream=False)):
torchaudio.save('sft_{}.wav'.format(i), j['tts_speech'], cosyvoice.sample_rate)
Expand Down
2 changes: 1 addition & 1 deletion cosyvoice/cli/cosyvoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(self, model_dir, load_jit=True, load_onnx=False, fp16=True):
self.model.load_onnx('{}/flow.decoder.estimator.fp32.onnx'.format(model_dir))
del configs

def list_avaliable_spks(self):
def list_available_spks(self):
spks = list(self.frontend.spk2info.keys())
return spks

Expand Down
2 changes: 1 addition & 1 deletion webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def main():
help='local path or modelscope repo id')
args = parser.parse_args()
cosyvoice = CosyVoice2(args.model_dir) if 'CosyVoice2' in args.model_dir else CosyVoice(args.model_dir)
sft_spk = cosyvoice.list_avaliable_spks()
sft_spk = cosyvoice.list_available_spks()
prompt_sr = 16000
default_data = np.zeros(cosyvoice.sample_rate)
main()

0 comments on commit 0f6ff29

Please sign in to comment.