mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-17 02:55:01 +08:00
[Minor] Fix typo and remove unused code (#2305)
This commit is contained in:
parent
77af974b40
commit
9140561059
@ -112,27 +112,6 @@ def _prune_hidden_states(
|
|||||||
sampling_metadata.selected_token_indices)
|
sampling_metadata.selected_token_indices)
|
||||||
|
|
||||||
|
|
||||||
def _get_prompt_and_output_tokens(
|
|
||||||
sampling_metadata: SamplingMetadata,
|
|
||||||
) -> Tuple[List[List[int]], List[List[int]]]:
|
|
||||||
prompt_tokens: List[List[int]] = []
|
|
||||||
output_tokens: List[List[int]] = []
|
|
||||||
for i, seq_group in enumerate(sampling_metadata.seq_groups):
|
|
||||||
seq_ids, sampling_params = seq_group
|
|
||||||
if (i < sampling_metadata.num_prompts
|
|
||||||
and sampling_params.prompt_logprobs is not None):
|
|
||||||
# NOTE: prompt token positions do not need output tokens to
|
|
||||||
# compute penalties.
|
|
||||||
prompt_len = sampling_metadata.prompt_lens[i]
|
|
||||||
prompt_tokens.extend([] for _ in range(prompt_len - 1))
|
|
||||||
output_tokens.extend([] for _ in range(prompt_len - 1))
|
|
||||||
for seq_id in seq_ids:
|
|
||||||
seq_data = sampling_metadata.seq_data[seq_id]
|
|
||||||
prompt_tokens.append(seq_data.prompt_token_ids)
|
|
||||||
output_tokens.append(seq_data.output_token_ids)
|
|
||||||
return prompt_tokens, output_tokens
|
|
||||||
|
|
||||||
|
|
||||||
def _get_bin_counts_and_mask(
|
def _get_bin_counts_and_mask(
|
||||||
tokens: torch.Tensor,
|
tokens: torch.Tensor,
|
||||||
vocab_size: int,
|
vocab_size: int,
|
||||||
|
|||||||
@ -100,7 +100,7 @@ class SamplingParams:
|
|||||||
temperature: float = 1.0,
|
temperature: float = 1.0,
|
||||||
top_p: float = 1.0,
|
top_p: float = 1.0,
|
||||||
top_k: int = -1,
|
top_k: int = -1,
|
||||||
min_p: int = 0.0,
|
min_p: float = 0.0,
|
||||||
use_beam_search: bool = False,
|
use_beam_search: bool = False,
|
||||||
length_penalty: float = 1.0,
|
length_penalty: float = 1.0,
|
||||||
early_stopping: Union[bool, str] = False,
|
early_stopping: Union[bool, str] = False,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user