Skip to content

Fix custom processors that use deleted import for Transformers v5 - #35101

Merged
vllm-bot merged 2 commits into
vllm-project:mainfrom
hmellor:v5-fix-hyperclovax
Feb 23, 2026
Merged

vllm-bot merged 2 commits into
vllm-project:mainfrom
hmellor:v5-fix-hyperclovax

Conversation

@hmellor

@hmellor hmellor commented Feb 23, 2026 •

Copy link
Copy Markdown
Member

Some remote code processors still import ChatTemplateLoadKwargs which was a subset of ProcessorChatTemplateKwargs as defined in Transformers v4. In Transformers v5 these were merged into ProcessorChatTemplateKwargs and ChatTemplateLoadKwargs was removed.

In vLLM CI, one architecture which does this is HCXVisionForCausalLM. If we upstream this architecture to Transformers, we can remove this backward compatibility patch in vLLM.

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request introduces a backward compatibility fix for HCXVisionForCausalLM to ensure its functionality with Transformers v5. This is achieved by aliasing a removed keyword argument. The changes are focused and address the compatibility issue effectively.

Comment thread vllm/transformers_utils/processor.py Outdated
old = getattr(processing_utils, "ChatTemplateLoadKwargs", None)
new = getattr(processing_utils, "ProcessorChatTemplateKwargs", None)
if old is None and new is not None:
processing_utils.ChatTemplateLoadKwargs = new

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Directly modifying a third-party library's module (processing_utils.ChatTemplateLoadKwargs = new) can be fragile and lead to unexpected behavior or breakage with future updates of the transformers library. While this is noted as a temporary solution, it introduces a dependency on the internal structure of transformers that might not be stable. Consider if there's an alternative way to achieve this compatibility without directly patching the module, or ensure this patch is rigorously tested against future transformers versions.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unfortunately necessary

@hmellor hmellor changed the title Fix HCXVisionForCausalLM for Transformers v5 Fix custom processors that use deleted import for Transformers v5 Feb 23, 2026
@DarkLight1337
DarkLight1337 enabled auto-merge (squash) February 23, 2026 14:25
@hmellor hmellor added the ready ONLY add when PR is ready to merge/full CI is needed label Feb 23, 2026
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
@vllm-bot
vllm-bot merged commit 864167d into vllm-project:main Feb 23, 2026
45 of 47 checks passed
@hmellor
hmellor deleted the v5-fix-hyperclovax branch February 23, 2026 16:44
Copilot AI pushed a commit to machov/vllm that referenced this pull request Mar 10, 2026
…lm-project#35101)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
jiangkuaixue123 pushed a commit to jiangkuaixue123/vllm that referenced this pull request Apr 28, 2026
…lm-project#35101)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
mystous pushed a commit to mystous/vllm_hybrid that referenced this pull request May 10, 2026
…lm-project#35101)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
my-other-github-account pushed a commit to my-other-github-account/vllm that referenced this pull request May 15, 2026
…lm-project#35101)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
0826joyce pushed a commit to 0826joyce/vllm-serving-optimization that referenced this pull request May 19, 2026
…lm-project#35101)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants