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
bb7991aa
Unverified
Commit
bb7991aa
authored
Nov 13, 2024
by
Roger Wang
Committed by
GitHub
Nov 13, 2024
Browse files
[V1] Add missing tokenizer options for `Detokenizer` (#10288)
Signed-off-by:
Roger Wang
<
ywang@roblox.com
>
parent
d909acf9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
vllm/v1/engine/detokenizer.py
vllm/v1/engine/detokenizer.py
+9
-2
vllm/v1/engine/llm_engine.py
vllm/v1/engine/llm_engine.py
+6
-1
No files found.
vllm/v1/engine/detokenizer.py
View file @
bb7991aa
...
@@ -192,10 +192,17 @@ class IncrementalDetokenizer:
...
@@ -192,10 +192,17 @@ class IncrementalDetokenizer:
class
Detokenizer
:
class
Detokenizer
:
def
__init__
(
self
,
tokenizer_name
:
str
):
def
__init__
(
self
,
tokenizer_name
:
str
,
tokenizer_mode
:
str
=
"auto"
,
trust_remote_code
:
bool
=
False
,
revision
:
Optional
[
str
]
=
None
):
# TODO: once we support LoRA, we should should pass the tokenizer
# TODO: once we support LoRA, we should should pass the tokenizer
# here. We currently have two copies (this + in the LLMEngine).
# here. We currently have two copies (this + in the LLMEngine).
self
.
tokenizer
=
get_tokenizer
(
tokenizer_name
)
self
.
tokenizer
=
get_tokenizer
(
tokenizer_name
=
tokenizer_name
,
tokenizer_mode
=
tokenizer_mode
,
trust_remote_code
=
trust_remote_code
,
revision
=
revision
)
# Request id -> IncrementalDetokenizer
# Request id -> IncrementalDetokenizer
self
.
request_states
:
Dict
[
str
,
IncrementalDetokenizer
]
=
{}
self
.
request_states
:
Dict
[
str
,
IncrementalDetokenizer
]
=
{}
...
...
vllm/v1/engine/llm_engine.py
View file @
bb7991aa
...
@@ -53,7 +53,12 @@ class LLMEngine:
...
@@ -53,7 +53,12 @@ class LLMEngine:
input_registry
)
input_registry
)
# Detokenizer (converts EngineCoreOutputs --> RequestOutput)
# Detokenizer (converts EngineCoreOutputs --> RequestOutput)
self
.
detokenizer
=
Detokenizer
(
vllm_config
.
model_config
.
tokenizer
)
self
.
detokenizer
=
Detokenizer
(
tokenizer_name
=
vllm_config
.
model_config
.
tokenizer
,
tokenizer_mode
=
vllm_config
.
model_config
.
tokenizer_mode
,
trust_remote_code
=
vllm_config
.
model_config
.
trust_remote_code
,
revision
=
vllm_config
.
model_config
.
tokenizer_revision
,
)
# EngineCore (gets EngineCoreRequests and gives EngineCoreOutputs)
# EngineCore (gets EngineCoreRequests and gives EngineCoreOutputs)
self
.
engine_core
=
EngineCoreClient
.
make_client
(
self
.
engine_core
=
EngineCoreClient
.
make_client
(
...
...
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