[Sampler] Support returning final logprobs (#22387)

Signed-off-by: 22quinn <33176974+22quinn@users.noreply.github.com>
Co-authored-by: Nick Hill <nhill@redhat.com>
Co-authored-by: Woosuk Kwon <woosuk.kwon@berkeley.edu>
This commit is contained in:
22quinn
2025-08-20 21:28:32 -07:00
committed by GitHub
co-authored by Nick Hill Woosuk Kwon
parent f64ee61d9e
commit f571ff8eb6
7 changed files with 125 additions and 69 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ class Sampler(nn.Module):
logits = self.apply_min_p(logits, sampling_metadata.min_p)
# Apply top_k and/or top_p.
random_sampled = self.topk_topp_sampler(
random_sampled, _ = self.topk_topp_sampler(
logits,
sampling_metadata.generators,
sampling_metadata.top_k,