Skip to content

Conversation

BeautyyuYanli
Copy link

@BeautyyuYanli BeautyyuYanli commented Aug 10, 2025

When the input is a text generator like

to_generate = [
    "收到好友从远方寄来的生日礼物",
    "那份意外的惊喜与深深的祝福",
    "让我心中充满了甜蜜的快乐",
    "笑容如花儿般绽放。",
]
def text_generator():
    for i in to_generate:
        yield i

for i, j in enumerate(cosyvoice.inference_instruct2(text_generator(), "用温柔的语音说", prompt_speech_16k, stream=False)):
    torchaudio.save('instruct_{}.wav'.format(i), j['tts_speech'], cosyvoice.sample_rate)

the text normalizer behavior is wrong.

@BeautyyuYanli BeautyyuYanli changed the title fix text generator as input [Bugfix] fix text generator as input Aug 10, 2025
@aluminumbox
Copy link
Collaborator

这样的修改的结果就是generator被当成了普通文本处理,虽然是可以正常前端处理,但generator的目的是双向流式推理,不应该这样修改

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

Successfully merging this pull request may close these issues.

2 participants