mirror of
https://github.com/vllm-project/vllm.git
synced 2025-10-20 23:03:52 +08:00
fix long dtype in topk sampling (#15049)
This commit is contained in:
@ -151,7 +151,7 @@ class Sampler(nn.Module):
|
||||
dim=-1)
|
||||
|
||||
# Get with the logprob of the prompt or sampled token.
|
||||
token_ids = token_ids.unsqueeze(-1)
|
||||
token_ids = token_ids.unsqueeze(-1).to(torch.long)
|
||||
token_logprobs = logprobs.gather(-1, token_ids)
|
||||
|
||||
# Compute the ranks of the actual token.
|
||||
|
Reference in New Issue
Block a user