fix: idx error when do repetition penalty (#738)

Co-authored-by: Ubuntu <zhn@zhn-a100.loq3xmynzuheffxht14poc5q4c.lx.internal.cloudapp.net>
This commit is contained in:
niuzheng168
2024-08-31 23:05:54 +08:00
committed by GitHub
parent a82e1df50d
commit 3990f0e6ea
+1
View File
@@ -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)