diff --git a/src/fairseq2/generation/step_processor.py b/src/fairseq2/generation/step_processor.py index c807b47ef..2e0e3b2df 100644 --- a/src/fairseq2/generation/step_processor.py +++ b/src/fairseq2/generation/step_processor.py @@ -106,7 +106,7 @@ def __call__(self, seqs: Tensor, probs: Tensor, lprob: bool = False) -> None: if (len_delta := banned_prefix_len - seqs.size(1)) > 0: # (N, S) -> (N, S_pre) - seqs = pad(seqs, (len_delta, -1)) + seqs = pad(seqs, (len_delta, 0), value=-1) elif len_delta < 0: # (N, S) -> (N, S_pre) seqs = seqs[:, -banned_prefix_len:]