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
dynamo
Commits
08a3763a
Unverified
Commit
08a3763a
authored
Aug 21, 2025
by
ishandhanani
Committed by
GitHub
Aug 21, 2025
Browse files
fix: `skip-tokenizer-init` by default in sglang (#2595)
parent
57728909
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
components/backends/sglang/src/dynamo/sglang/args.py
components/backends/sglang/src/dynamo/sglang/args.py
+7
-0
components/backends/sglang/src/dynamo/sglang/request_handlers/decode_handler.py
...lang/src/dynamo/sglang/request_handlers/decode_handler.py
+8
-1
No files found.
components/backends/sglang/src/dynamo/sglang/args.py
View file @
08a3763a
...
...
@@ -128,6 +128,13 @@ def parse_args(args: list[str]) -> Config:
server_args
=
ServerArgs
.
from_cli_args
(
parsed_args
)
if
not
server_args
.
skip_tokenizer_init
:
logging
.
warning
(
"When using the dynamo frontend (python3 -m dynamo.frontend), we perform tokenization and detokenization "
"in the frontend. Automatically setting --skip-tokenizer-init to True."
)
server_args
.
skip_tokenizer_init
=
True
return
Config
(
server_args
,
dynamo_args
)
...
...
components/backends/sglang/src/dynamo/sglang/request_handlers/decode_handler.py
View file @
08a3763a
...
...
@@ -102,7 +102,14 @@ class DecodeWorkerHandler(BaseWorkerHandler):
if
finish_reason
:
out
=
{
"token_ids"
:
[],
"finish_reason"
:
finish_reason
[
"type"
]}
else
:
next_total_toks
=
len
(
res
[
"output_ids"
])
try
:
next_total_toks
=
len
(
res
[
"output_ids"
])
except
KeyError
:
raise
ValueError
(
f
"Missing 'output_ids' in response. This often happens when using skip_tokenizer_init=True. "
f
"If you're using ModelType.CHAT or custom model configurations, you may need to modify "
f
"the tokenization/detokenization logic in your handler. Response keys:
{
list
(
res
.
keys
())
}
"
)
out
=
{
"token_ids"
:
res
[
"output_ids"
][
num_output_tokens_so_far
:]}
num_output_tokens_so_far
=
next_total_toks
...
...
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