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 c4ed6c1 commit f2bc45fCopy full SHA for f2bc45f
vllm/model_executor/layers/sampler.py
@@ -433,12 +433,9 @@ def _apply_top_k_top_p(
433
logits_sort.masked_fill_(top_p_mask, -float("inf"))
434
435
# Re-sort the probabilities.
436
- src = torch.arange(logits_idx.shape[-1],
437
- device=logits_idx.device).expand_as(logits_idx)
438
- logits_idx_inv = torch.empty_like(logits_idx).scatter_(dim=-1,
439
- index=logits_idx,
440
- src=src)
441
- logits = torch.gather(logits_sort, dim=-1, index=logits_idx_inv)
+ logits = torch.empty_like(logits_sort).scatter_(dim=-1,
+ index=logits_idx,
+ src=logits_sort)
442
return logits
443
444
0 commit comments