Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
norm
vllm
Commits
91405610
Unverified
Commit
91405610
authored
Jan 03, 2024
by
Roy
Committed by
GitHub
Jan 02, 2024
Browse files
[Minor] Fix typo and remove unused code (#2305)
parent
77af974b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
22 deletions
+1
-22
vllm/model_executor/layers/sampler.py
vllm/model_executor/layers/sampler.py
+0
-21
vllm/sampling_params.py
vllm/sampling_params.py
+1
-1
No files found.
vllm/model_executor/layers/sampler.py
View file @
91405610
...
@@ -112,27 +112,6 @@ def _prune_hidden_states(
...
@@ -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
,
...
...
vllm/sampling_params.py
View file @
91405610
...
@@ -100,7 +100,7 @@ class SamplingParams:
...
@@ -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
:
in
t
=
0.0
,
min_p
:
floa
t
=
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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment