We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9413b8b commit 71b231dCopy full SHA for 71b231d
src/transformers/generation/utils.py
@@ -3246,7 +3246,7 @@ def _sample(
3246
3247
# Clone is needed to avoid keeping a hanging ref to outputs.logits which may be very large for first iteration
3248
# (the clone itself is always small)
3249
- next_token_logits = outputs.logits.clone()[:, -1, :].float()
+ next_token_logits = outputs.logits[:, -1, :].clone().float()
3250
next_token_logits = next_token_logits.to(input_ids.device)
3251
3252
# pre-process distribution
0 commit comments