Skip to content

[Bugfix] fix text generator as input #1517

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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
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.

1 participant