A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 15, 04:45 UTC
[Bugfix] Fix processor initialization in transformers 4.53.0 (#20244)
Signed-off-by: Isotr0py <2037008807@qq.com>
Isotr0py committed
Jun 30, 2025 at 18:16 UTC
e936e401debe7fba64d6462666d7dc632bc76357
1 file changed
+7
-1
vllm/inputs/registry.py
+7
-1
@@ -5,7 +5,9 @@ from dataclasses import dataclass
5
from typing import TYPE_CHECKING, Any, NamedTuple, Optional, Union
6
7
import torch
8
+from packaging.version import Version
9
from transformers import BatchFeature, PretrainedConfig, ProcessorMixin
10
+from transformers import __version__ as TRANSFORMERS_VERSION
11
from typing_extensions import TypeVar
12
13
from vllm.jsontree import JSONTree, json_map_leaves
@@ -128,9 +130,13 @@ class InputProcessingContext(InputContext):
130
/,
131
**kwargs: object,
132
) -> _P:
133
+ # Transformers 4.53.0 has issue with passing tokenizer to
134
+ # initialize processor. We disable it for this version.
135
+ # See: https://github.com/vllm-project/vllm/issues/20224
136
+ if Version(TRANSFORMERS_VERSION) != Version("4.53.0"):
137
+ kwargs["tokenizer"] = self.tokenizer
138
return super().get_hf_processor(
139
typ,
133
- tokenizer=self.tokenizer,
140
**kwargs,
141
)
142