mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-10 00:25:01 +08:00
Set replacement=True in torch.multinomial (#858)
This commit is contained in:
parent
75c0ca9d43
commit
94d2f59895
@ -302,7 +302,9 @@ def _sample_from_prompt(
|
||||
# Random sampling.
|
||||
# Sample `best_of` tokens for the prompt.
|
||||
num_seqs = sampling_params.best_of
|
||||
next_token_ids = torch.multinomial(prob, num_samples=num_seqs)
|
||||
next_token_ids = torch.multinomial(prob,
|
||||
num_samples=num_seqs,
|
||||
replacement=True)
|
||||
next_token_ids = next_token_ids.tolist()
|
||||
return next_token_ids
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user