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
fb980eb2
Unverified
Commit
fb980eb2
authored
Dec 17, 2025
by
Harry Mellor
Committed by
GitHub
Dec 17, 2025
Browse files
Fix lazy import (#30858)
Signed-off-by:
Harry Mellor
<
19981378+hmellor@users.noreply.github.com
>
parent
84896fda
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
vllm/v1/structured_output/utils.py
vllm/v1/structured_output/utils.py
+6
-4
No files found.
vllm/v1/structured_output/utils.py
View file @
fb980eb2
...
...
@@ -20,9 +20,9 @@ from vllm.v1.core.sched.output import GrammarOutput, SchedulerOutput
if
TYPE_CHECKING
:
import
outlines_core
as
oc
import
transformers.convert_slow_tokenizer
as
convert_slow_tokenizer
import
transformers.file_utils
as
file_utils
import
xgrammar
as
xgr
from
transformers.convert_slow_tokenizer
import
bytes_to_unicode
from
vllm.tokenizers
import
TokenizerLike
from
vllm.v1.worker.gpu_input_batch
import
InputBatch
...
...
@@ -30,8 +30,8 @@ else:
xgr
=
LazyLoader
(
"xgr"
,
globals
(),
"xgrammar"
)
oc
=
LazyLoader
(
"oc"
,
globals
(),
"outlines_core"
)
file_utils
=
LazyLoader
(
"file_utils"
,
globals
(),
"transformers.file_utils"
)
bytes_to_unicode
=
LazyLoader
(
"
bytes_to_unicode
"
,
globals
(),
"transformers.convert_slow_tokenizer"
convert_slow_tokenizer
=
LazyLoader
(
"
convert_slow_tokenizer
"
,
globals
(),
"transformers.convert_slow_tokenizer"
)
TokenizerLike
=
object
...
...
@@ -202,7 +202,9 @@ def _reduced_vocabulary(
A Dict of token string -> equivalent token ids
"""
unicode_to_bytes
=
{
v
:
k
for
k
,
v
in
bytes_to_unicode
().
items
()}
unicode_to_bytes
=
{
v
:
k
for
k
,
v
in
convert_slow_tokenizer
.
bytes_to_unicode
().
items
()
}
def
convert_token_to_string
(
token
:
str
)
->
str
:
string
=
tokenizer
.
convert_tokens_to_string
([
token
])
...
...
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