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
0a05ed57
Unverified
Commit
0a05ed57
authored
Apr 24, 2025
by
Harry Mellor
Committed by
GitHub
Apr 24, 2025
Browse files
Simplify `TokenizerGroup` (#16790)
Signed-off-by:
Harry Mellor
<
19981378+hmellor@users.noreply.github.com
>
parent
14288d13
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
8 deletions
+4
-8
vllm/v1/engine/output_processor.py
vllm/v1/engine/output_processor.py
+2
-2
vllm/v1/engine/processor.py
vllm/v1/engine/processor.py
+2
-2
vllm/v1/structured_output/backend_guidance.py
vllm/v1/structured_output/backend_guidance.py
+0
-2
vllm/v1/structured_output/backend_xgrammar.py
vllm/v1/structured_output/backend_xgrammar.py
+0
-2
No files found.
vllm/v1/engine/output_processor.py
View file @
0a05ed57
...
@@ -8,7 +8,7 @@ from typing import Optional, Union
...
@@ -8,7 +8,7 @@ from typing import Optional, Union
from
vllm.outputs
import
CompletionOutput
,
RequestOutput
from
vllm.outputs
import
CompletionOutput
,
RequestOutput
from
vllm.sampling_params
import
RequestOutputKind
from
vllm.sampling_params
import
RequestOutputKind
from
vllm.transformers_utils.tokenizer
import
AnyTokenizer
from
vllm.transformers_utils.tokenizer
import
AnyTokenizer
from
vllm.transformers_utils.tokenizer_group
import
Base
TokenizerGroup
from
vllm.transformers_utils.tokenizer_group
import
TokenizerGroup
from
vllm.v1.engine
import
EngineCoreOutput
,
EngineCoreRequest
,
FinishReason
from
vllm.v1.engine
import
EngineCoreOutput
,
EngineCoreRequest
,
FinishReason
from
vllm.v1.engine.detokenizer
import
IncrementalDetokenizer
from
vllm.v1.engine.detokenizer
import
IncrementalDetokenizer
from
vllm.v1.engine.logprobs
import
LogprobsProcessor
from
vllm.v1.engine.logprobs
import
LogprobsProcessor
...
@@ -225,7 +225,7 @@ class OutputProcessor:
...
@@ -225,7 +225,7 @@ class OutputProcessor:
def
__init__
(
def
__init__
(
self
,
self
,
tokenizer
:
Base
TokenizerGroup
,
tokenizer
:
TokenizerGroup
,
log_stats
:
bool
,
log_stats
:
bool
,
):
):
self
.
log_stats
=
log_stats
self
.
log_stats
=
log_stats
...
...
vllm/v1/engine/processor.py
View file @
0a05ed57
...
@@ -17,7 +17,7 @@ from vllm.multimodal.utils import merge_and_sort_multimodal_metadata
...
@@ -17,7 +17,7 @@ from vllm.multimodal.utils import merge_and_sort_multimodal_metadata
from
vllm.pooling_params
import
PoolingParams
from
vllm.pooling_params
import
PoolingParams
from
vllm.prompt_adapter.request
import
PromptAdapterRequest
from
vllm.prompt_adapter.request
import
PromptAdapterRequest
from
vllm.sampling_params
import
SamplingParams
from
vllm.sampling_params
import
SamplingParams
from
vllm.transformers_utils.tokenizer_group
import
Base
TokenizerGroup
from
vllm.transformers_utils.tokenizer_group
import
TokenizerGroup
from
vllm.v1.engine
import
EngineCoreRequest
from
vllm.v1.engine
import
EngineCoreRequest
from
vllm.v1.engine.mm_input_cache
import
MirroredProcessingCache
from
vllm.v1.engine.mm_input_cache
import
MirroredProcessingCache
from
vllm.v1.structured_output.backend_guidance
import
(
from
vllm.v1.structured_output.backend_guidance
import
(
...
@@ -31,7 +31,7 @@ class Processor:
...
@@ -31,7 +31,7 @@ class Processor:
def
__init__
(
def
__init__
(
self
,
self
,
vllm_config
:
VllmConfig
,
vllm_config
:
VllmConfig
,
tokenizer
:
Base
TokenizerGroup
,
tokenizer
:
TokenizerGroup
,
mm_registry
:
MultiModalRegistry
=
MULTIMODAL_REGISTRY
,
mm_registry
:
MultiModalRegistry
=
MULTIMODAL_REGISTRY
,
):
):
...
...
vllm/v1/structured_output/backend_guidance.py
View file @
0a05ed57
...
@@ -61,9 +61,7 @@ class GuidanceBackend(StructuredOutputBackend):
...
@@ -61,9 +61,7 @@ class GuidanceBackend(StructuredOutputBackend):
tokenizer_group
=
init_tokenizer_from_configs
(
tokenizer_group
=
init_tokenizer_from_configs
(
model_config
=
vllm_config
.
model_config
,
model_config
=
vllm_config
.
model_config
,
scheduler_config
=
vllm_config
.
scheduler_config
,
scheduler_config
=
vllm_config
.
scheduler_config
,
parallel_config
=
vllm_config
.
parallel_config
,
lora_config
=
vllm_config
.
lora_config
)
# type: ignore[arg-type]
lora_config
=
vllm_config
.
lora_config
)
# type: ignore[arg-type]
tokenizer_group
.
ping
()
self
.
vllm_config
=
vllm_config
self
.
vllm_config
=
vllm_config
self
.
vocab_size
=
vllm_config
.
model_config
.
get_vocab_size
()
self
.
vocab_size
=
vllm_config
.
model_config
.
get_vocab_size
()
...
...
vllm/v1/structured_output/backend_xgrammar.py
View file @
0a05ed57
...
@@ -35,9 +35,7 @@ class XgrammarBackend(StructuredOutputBackend):
...
@@ -35,9 +35,7 @@ class XgrammarBackend(StructuredOutputBackend):
tokenizer_group
=
init_tokenizer_from_configs
(
tokenizer_group
=
init_tokenizer_from_configs
(
model_config
=
vllm_config
.
model_config
,
model_config
=
vllm_config
.
model_config
,
scheduler_config
=
vllm_config
.
scheduler_config
,
scheduler_config
=
vllm_config
.
scheduler_config
,
parallel_config
=
vllm_config
.
parallel_config
,
lora_config
=
vllm_config
.
lora_config
)
# type: ignore[arg-type]
lora_config
=
vllm_config
.
lora_config
)
# type: ignore[arg-type]
tokenizer_group
.
ping
()
self
.
disable_any_whitespace
=
False
self
.
disable_any_whitespace
=
False
backend_options
=
GuidedDecodingParams
(
backend_options
=
GuidedDecodingParams
(
...
...
Prev
1
2
Next
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