CosyVoice icon indicating copy to clipboard operation
CosyVoice copied to clipboard

有朋友试过流式输入吗?首包延迟和质量怎么样?

Open jetsonearth opened this issue 8 months ago • 10 comments

rt

jetsonearth avatar May 07 '25 01:05 jetsonearth

输出不是输入吧? 质量的话torchaudio直出ogg效果差,出wav自己过ffmpeg编码会好很多

foxmale007 avatar May 07 '25 05:05 foxmale007

输出不是输入吧? 质量的话torchaudio直出ogg效果差,出wav自己过ffmpeg编码会好很多

就是问的流式输入。比如接入到大模型的输出(现在llm都支持streaming output了,那我就直接把output stream给cosyvoice,实现低延时speech generation)

jetsonearth avatar May 07 '25 06:05 jetsonearth

流式输入的话,对 LLM 输出做 combination 和 sentence segmentation 就好了。保证质量的话,首包延迟最低在 <3s。

shenduldh avatar May 07 '25 10:05 shenduldh

流式输入的话,对 LLM 输出做 combination 和 sentence segmentation 就好了。保证质量的话,首包延迟最低在 <3s。

还是挺慢的。我其实在调用api,我最低能做到sub-second,我没用这个本地模型

jetsonearth avatar May 08 '25 07:05 jetsonearth

流式输入的话,对 LLM 输出做 combination 和 sentence segmentation 就好了。保证质量的话,首包延迟最低在 <3s。

但sentence segmentation有点慢,我是很好奇能不能做到1-2个词就生成,不牺牲质量

jetsonearth avatar May 08 '25 07:05 jetsonearth

我试过,大模型返回的词,10个左右按符号分段。然后流式输出,首包2秒左右,后面0.8一个

string199 avatar May 08 '25 11:05 string199

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Jun 08 '25 02:06 github-actions[bot]

流式输入的话,对 LLM 输出做 combination 和 sentence segmentation 就好了。保证质量的话,首包延迟最低在 <3s。

还是挺慢的。我其实在调用api,我最低能做到sub-second,我没用这个本地模型

请问大佬,开源版本支持流式输入吗

lxd0622 avatar Jun 19 '25 07:06 lxd0622

你可以将大模型返回的流自己切分成句子,一句话调用一次cosyvoice,自己写个ws的接口实现。 阿里云官方的cosyvoice就是ws传入的,但是我感觉如果你丢入一个没有标点符号的句子,不发送finish-task的指令,阿里云官方的也没有语音输出

pzw943969386 avatar Jun 19 '25 09:06 pzw943969386

你可以将大模型返回的流自己切分成句子,一句话调用一次cosyvoice,自己写个ws的接口实现。 阿里云官方的cosyvoice就是ws传入的,但是我感觉如果你丢入一个没有标点符号的句子,不发送finish-task的指令,阿里云官方的也没有语音输出

有案例代码吗

zkt168 avatar Oct 27 '25 14:10 zkt168