Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
01692be6
Commit
01692be6
authored
Aug 20, 2025
by
王敏
Browse files
[fix]v0 SamplerOutput在非tree decoding时不传入logits
parent
9a4a94ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
vllm/model_executor/layers/sampler.py
vllm/model_executor/layers/sampler.py
+3
-1
No files found.
vllm/model_executor/layers/sampler.py
View file @
01692be6
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
"""A layer that samples the next tokens from the model's outputs."""
"""A layer that samples the next tokens from the model's outputs."""
import
os
import
itertools
import
itertools
from
collections.abc
import
Iterator
from
collections.abc
import
Iterator
from
dataclasses
import
dataclass
from
dataclasses
import
dataclass
...
@@ -210,6 +211,7 @@ class Sampler(nn.Module):
...
@@ -210,6 +211,7 @@ class Sampler(nn.Module):
# speculative decoding and when prompt embeddings are specified.
# speculative decoding and when prompt embeddings are specified.
self
.
include_gpu_probs_tensor
=
False
self
.
include_gpu_probs_tensor
=
False
self
.
should_modify_greedy_probs_inplace
=
False
self
.
should_modify_greedy_probs_inplace
=
False
self
.
tree_decoding
=
(
os
.
environ
.
get
(
'VLLM_TREE_DECODING'
)
==
'1'
)
def
_init_sampling_tensors
(
def
_init_sampling_tensors
(
self
,
self
,
...
@@ -347,7 +349,7 @@ class Sampler(nn.Module):
...
@@ -347,7 +349,7 @@ class Sampler(nn.Module):
sample_logprobs
,
sample_logprobs
,
on_device_tensors
=
on_device_tensors
,
on_device_tensors
=
on_device_tensors
,
skip_sampler_cpu_output
=
sampling_metadata
.
skip_sampler_cpu_output
,
skip_sampler_cpu_output
=
sampling_metadata
.
skip_sampler_cpu_output
,
logits
=
logits
)
logits
=
logits
if
self
.
tree_decoding
else
None
)
@
property
@
property
def
_should_modify_greedy_probs_inplace
(
self
)
->
bool
:
def
_should_modify_greedy_probs_inplace
(
self
)
->
bool
:
...
...
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