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, 01:00 UTC
[Chore] Remove outdated transformers check (#20989)
Signed-off-by: Brayden Zhong <b8zhong@uwaterloo.ca>
Brayden Zhong committed
Jul 15, 2025 at 22:42 UTC
75a99b98bf8e96b573f0c695291912a4ac8d8180
1 file changed
+4
-11
vllm/model_executor/models/idefics3.py
+4
-11
@@ -22,8 +22,8 @@ from typing import Literal, Optional, TypedDict, Union
22
23
import torch
24
from torch import nn
25
-from transformers import (AddedToken, BatchFeature, Idefics3Config,
26
- Idefics3ImageProcessor, Idefics3Processor)
25
+from transformers import (BatchFeature, Idefics3Config, Idefics3ImageProcessor,
26
+ Idefics3Processor)
27
28
from vllm.config import VllmConfig
29
from vllm.model_executor.layers.linear import ReplicatedLinear
@@ -199,21 +199,14 @@ class Idefics3ProcessingInfo(BaseProcessingInfo):
199
200
return grid_w * grid_h + 1
201
202
- # TODO: Remove after requiring transformers>=4.52
203
- def _get_content(self, token: Union[AddedToken, str]) -> str:
204
- if isinstance(token, str):
205
- return token
206
-
207
- return token.content
208
-
202
def _get_image_token(
203
self,
204
processor: Optional[Idefics3Processor]) -> tuple[str, str, str]:
205
if processor is None:
206
processor = self.get_hf_processor()
207
215
- image_token = self._get_content(processor.image_token)
216
- fake_image_token = self._get_content(processor.fake_image_token)
208
+ image_token = processor.image_token
209
+ fake_image_token = processor.fake_image_token
210
global_image_token = processor.global_image_tag
211
return image_token, fake_image_token, global_image_token
212