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
bb6d8c21
Unverified
Commit
bb6d8c21
authored
Oct 08, 2025
by
Nick Hill
Committed by
GitHub
Oct 08, 2025
Browse files
[Bugfix] Catch and log invalid token ids in detokenizer #2 (#26445)
Signed-off-by:
Nick Hill
<
nhill@redhat.com
>
parent
ebf6ef1a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
vllm/v1/engine/detokenizer.py
vllm/v1/engine/detokenizer.py
+2
-2
No files found.
vllm/v1/engine/detokenizer.py
View file @
bb6d8c21
...
@@ -227,10 +227,10 @@ class FastIncrementalDetokenizer(BaseIncrementalDetokenizer):
...
@@ -227,10 +227,10 @@ class FastIncrementalDetokenizer(BaseIncrementalDetokenizer):
def
_protected_step
(
self
,
next_token_id
:
int
)
->
Optional
[
str
]:
def
_protected_step
(
self
,
next_token_id
:
int
)
->
Optional
[
str
]:
try
:
try
:
token
=
self
.
stream
.
step
(
self
.
tokenizer
,
next_token_id
)
token
=
self
.
stream
.
step
(
self
.
tokenizer
,
next_token_id
)
except
OverflowError
:
except
(
OverflowError
,
TypeError
)
:
# Handle rare observed overflow, still to be diagnosed.
# Handle rare observed overflow, still to be diagnosed.
# See https://github.com/vllm-project/vllm/issues/21951.
# See https://github.com/vllm-project/vllm/issues/21951.
logger
.
exception
(
"Encountered invalid token id: %
d
"
,
next_token_id
)
logger
.
exception
(
"Encountered invalid token id: %
r
"
,
next_token_id
)
token
=
None
token
=
None
except
Exception
as
e
:
except
Exception
as
e
:
if
not
str
(
e
).
startswith
(
INVALID_PREFIX_ERR_MSG
):
if
not
str
(
e
).
startswith
(
INVALID_PREFIX_ERR_MSG
):
...
...
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