From f56c2583e86040e2758bbbd57d9ca5757dfa8cf6 Mon Sep 17 00:00:00 2001 From: 0xCAFEBABE0 Date: Thu, 12 Dec 2024 16:53:30 +0800 Subject: [PATCH] fix(bug).when generating text that contains only punctuation marks or whitespace characters, the CPU usage reaches 100%, and the process crashes. --- cosyvoice/cli/model.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cosyvoice/cli/model.py b/cosyvoice/cli/model.py index 22affe4..d878fc1 100644 --- a/cosyvoice/cli/model.py +++ b/cosyvoice/cli/model.py @@ -147,7 +147,6 @@ class CosyVoiceModel: flow_prompt_speech_token=torch.zeros(1, 0, dtype=torch.int32), prompt_speech_feat=torch.zeros(1, 0, 80), stream=False, speed=1.0, **kwargs): if is_only_punctuation(text): - logging.info('only punctuation, skip synthesis:{}'.format(text)) return {'tts_speech': torch.zeros(1, int(0.01 * 22050))} #返回10ms空白音频,保证了一致的上下游处理逻辑 # this_uuid is used to track variables related to this inference thread this_uuid = str(uuid.uuid1())