From 3990f0e6ea350459d466c7325560a818a965488b Mon Sep 17 00:00:00 2001 From: niuzheng168 Date: Sat, 31 Aug 2024 23:05:54 +0800 Subject: [PATCH] fix: idx error when do repetition penalty (#738) Co-authored-by: Ubuntu --- ChatTTS/model/velocity/model_runner.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ChatTTS/model/velocity/model_runner.py b/ChatTTS/model/velocity/model_runner.py index 2f9d7e4..ed57b8e 100644 --- a/ChatTTS/model/velocity/model_runner.py +++ b/ChatTTS/model/velocity/model_runner.py @@ -526,6 +526,7 @@ class ModelRunner: for i in range(self.post_model.num_vq) ] input_emb = torch.stack(code_emb, 3).sum(3) + start_idx = input_tokens_history.shape[-2] - 1 if input_tokens_history.shape[-2] > 0 else 0 else: input_emb = self.post_model(input_tokens, text_mask) # print(input_emb.shape)