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
cb528d05
Unverified
Commit
cb528d05
authored
May 13, 2025
by
Aaron Pham
Committed by
GitHub
May 13, 2025
Browse files
[Fix] check to make sure processor has chat templates (#18047)
Signed-off-by:
Aaron Pham
<
contact@aarnphm.xyz
>
parent
98fcba15
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
tests/compile/test_pass_manager.py
tests/compile/test_pass_manager.py
+1
-1
vllm/compilation/inductor_pass.py
vllm/compilation/inductor_pass.py
+1
-1
vllm/entrypoints/chat_utils.py
vllm/entrypoints/chat_utils.py
+2
-2
No files found.
tests/compile/test_pass_manager.py
View file @
cb528d05
...
@@ -22,7 +22,7 @@ def test_bad_callable():
...
@@ -22,7 +22,7 @@ def test_bad_callable():
pass_manager
.
configure
(
config
)
pass_manager
.
configure
(
config
)
with
pytest
.
raises
(
AssertionError
):
with
pytest
.
raises
(
AssertionError
):
pass_manager
.
add
(
simple_callable
)
# noqa, type wrong on purpose
pass_manager
.
add
(
simple_callable
)
# Pass that inherits from InductorPass
# Pass that inherits from InductorPass
...
...
vllm/compilation/inductor_pass.py
View file @
cb528d05
...
@@ -16,7 +16,7 @@ if is_torch_equal_or_newer("2.6"):
...
@@ -16,7 +16,7 @@ if is_torch_equal_or_newer("2.6"):
from
torch._inductor.custom_graph_pass
import
CustomGraphPass
from
torch._inductor.custom_graph_pass
import
CustomGraphPass
else
:
else
:
# CustomGraphPass is not present in 2.5 or lower, import our version
# CustomGraphPass is not present in 2.5 or lower, import our version
from
.torch25_custom_graph_pass
import
(
# noqa:
yapf
from
.torch25_custom_graph_pass
import
(
# noqa:
E501
Torch25CustomGraphPass
as
CustomGraphPass
)
Torch25CustomGraphPass
as
CustomGraphPass
)
_pass_context
=
None
_pass_context
=
None
...
...
vllm/entrypoints/chat_utils.py
View file @
cb528d05
...
@@ -349,11 +349,11 @@ def resolve_hf_chat_template(
...
@@ -349,11 +349,11 @@ def resolve_hf_chat_template(
trust_remote_code
=
model_config
.
trust_remote_code
,
trust_remote_code
=
model_config
.
trust_remote_code
,
)
)
if
isinstance
(
processor
,
ProcessorMixin
)
and
\
if
isinstance
(
processor
,
ProcessorMixin
)
and
\
hasattr
(
processor
,
'chat_template'
)
and
\
processor
.
chat_template
is
not
None
:
processor
.
chat_template
is
not
None
:
return
processor
.
chat_template
return
processor
.
chat_template
except
Exception
:
except
Exception
:
logger
.
debug
(
"Failed to load AutoProcessor chat template for %s"
,
logger
.
debug
(
"Failed to load AutoProcessor chat template for %s"
,
tokenizer
.
name_or_path
,
exc_info
=
True
)
# noqa: E501
tokenizer
.
name_or_path
,
exc_info
=
True
)
# 3rd priority: AutoTokenizer chat template
# 3rd priority: AutoTokenizer chat template
try
:
try
:
...
...
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