From 7fdd80dc648ec867c61b6b89fea042d475cd64b6 Mon Sep 17 00:00:00 2001 From: "lyuxiang.lx" Date: Wed, 7 Jan 2026 07:12:52 +0000 Subject: [PATCH] fix padding --- cosyvoice/llm/llm.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cosyvoice/llm/llm.py b/cosyvoice/llm/llm.py index f525b7a..f48b6da 100644 --- a/cosyvoice/llm/llm.py +++ b/cosyvoice/llm/llm.py @@ -314,6 +314,7 @@ class Qwen2LM(TransformerLM): else: instruct_token = [torch.empty(0).to(text_token[0])] * len(text_token) instruct_token_emb = [torch.empty(0, 896).to(text_token_emb[0])] * len(text_token) + instruct_token_len = torch.zeros(len(text_token)).to(text_token_len) for i in range(len(text_token)): # bistream sequence if random.random() < 0.5 and speech_token_len[i] / text_token_len[i] > self.mix_ratio[1] / self.mix_ratio[0]: