Skip to content

Commit

Permalink
[BugFix] Fix seeded random sampling with encoder-decoder models (vllm…
Browse files Browse the repository at this point in the history
…-project#8870)

Co-authored-by: Roger Wang <ywang@roblox.com>
  • Loading branch information
njhill and ywang96 authored Sep 29, 2024
1 parent 3d49776 commit 31f46a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vllm/worker/enc_dec_model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,13 @@ def prepare_model_input(
encoder_input_positions=encoder_input_positions_tensor,
)

generators = self.get_generators(finished_requests_ids)
sampling_metadata = SamplingMetadata.prepare(seq_group_metadata_list,
model_input.seq_lens,
model_input.query_lens,
self.device,
self.pin_memory)
self.pin_memory,
generators=generators)
is_prompt = (seq_group_metadata_list[0].is_prompt
if seq_group_metadata_list else None)
return dataclasses.replace(model_input,
Expand Down

0 comments on commit 31f46a0

Please sign in to comment.