[Core] Use array to speedup padding (#6779)

This commit is contained in:
Peng Guanwen
2024-07-25 21:31:31 -07:00
committed by GitHub
parent 084a01fd35
commit 89a84b0bb7
3 changed files with 29 additions and 17 deletions
+1 -1
View File
@@ -220,7 +220,7 @@ def _apply_min_tokens_penalty(
seqs_to_penalize: List[int] = []
for j, seq_id in enumerate(seq_ids):
seq_data = seq_group.seq_data[seq_id]
if len(seq_data.output_token_ids) < min_tokens:
if len(seq_data.output_token_ids_array) < min_tokens:
seqs_to_penalize.append(j)
if seqs_to_penalize: