Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Frontend] Make beam search emulator temperature modifiable #8928

Merged
merged 1 commit into from
Sep 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion vllm/entrypoints/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ def beam_search(
beam_width: int,
max_tokens: int,
ignore_eos: bool = False,
temperature: float = 0.0,
) -> List[BeamSearchOutput]:
"""
Generate sequences using beam search.
Expand All @@ -405,6 +406,7 @@ def beam_search(
of token IDs.
beam_width: The number of beams to keep at each step.
max_tokens: The max number of tokens to generate for each prompt.
temperature: The temperature to use for generation.

TODO: how does beam search work together with length penalty, frequency
penalty, and stopping criteria, etc.?
Expand All @@ -416,7 +418,7 @@ def beam_search(
# at https://github.com/huggingface/transformers/blob/e15687fffe5c9d20598a19aeab721ae0a7580f8a/src/transformers/generation/beam_search.py#L534 # noqa
beam_search_params = SamplingParams(logprobs=2 * beam_width,
max_tokens=1,
temperature=0.0)
temperature=temperature)
instances: List[BeamSearchInstance] = []

for prompt in prompts:
Expand Down
Loading