fix(async_cosyvoice): 恢复原本文本令牌处理逻辑

- 在 Frontend 中,恢复原本逐个生成文本令牌
- 在 Model 类中,移除了不必要的日志信息和断言,简化了文本令牌的处理流程
This commit is contained in:
qihua
2025-03-08 16:03:35 +08:00
parent ab5b8eb160
commit c0f6a474f3
2 changed files with 2 additions and 14 deletions

View File

@@ -102,9 +102,8 @@ class CosyVoiceFrontEnd:
def _extract_text_token_generator(self, text_generator):
for text in text_generator:
text_token, _ = self._extract_text_token(text)
# for i in range(text_token.shape[1]):
# yield text_token[:, i: i + 1]
yield text_token
for i in range(text_token.shape[1]):
yield text_token[:, i: i + 1]
def _extract_speech_token(self, speech):
assert speech.shape[1] / 16000 <= 30, 'do not support extract speech token for audio longer than 30s'