mirror of
https://github.com/FunAudioLLM/CosyVoice.git
synced 2026-02-04 17:39:25 +08:00
fix(async_cosyvoice): 恢复原本文本令牌处理逻辑
- 在 Frontend 中,恢复原本逐个生成文本令牌 - 在 Model 类中,移除了不必要的日志信息和断言,简化了文本令牌的处理流程
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user