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 8, 11:15 UTC
[Bugfix] Fix more multimodal tests for transformers V5 (#34334)
Signed-off-by: raushan <raushan@huggingface.co>
Raushan Turganbay committed
Feb 11, 2026 at 22:02 UTC
527ca32197b327e55bc718c0ecfea27ff8995902
5 files changed
+18
-11
tests/models/multimodal/processing/test_common.py
+1
@@ -108,6 +108,7 @@ _ADD_SPECIAL_TOKENS_OVERRIDES = {
108
"paligemma": False,
109
"ultravox": False,
110
"whisper": False,
111
+ "lfm2_vl": False,
112
}
113
114
_IGNORE_MM_KEYS = {
vllm/model_executor/models/glmasr.py
+3
-3
@@ -810,9 +810,9 @@ class GlmAsrMultiModalProcessor(BaseMultiModalProcessor["GlmAsrProcessingInfo"])
810
811
# Postprocess: rename mask and add chunk counts
812
# Handle different key names from different transformers versions
813
- if "input_feature_mask" in outputs:
814
- outputs["feature_attention_mask"] = outputs.pop("input_feature_mask")
815
- elif "feature_attention_mask" not in outputs and "input_features" in outputs:
813
+ if "input_features_mask" in outputs:
814
+ outputs["feature_attention_mask"] = outputs.pop("input_features_mask")
815
+ elif "input_features_mask" not in outputs and "input_features" in outputs:
816
# If no mask is provided, create one from input_features
817
input_features = outputs["input_features"]
818
if isinstance(input_features, torch.Tensor):
vllm/model_executor/models/glmasr_utils.py
+2
-2
@@ -18,8 +18,8 @@ def _calculate_conv_output_length(
18
input_length: torch.Tensor, padding: int, kernel_size: int, stride: int
19
) -> torch.Tensor:
20
"""Calculate Conv1d output length using standard formula."""
21
- # Standard formula: floor((input + 2*padding - kernel_size) / stride) + 1
22
- return (input_length + 2 * padding - kernel_size) // stride + 1
21
+ # in sync with `hf_processor._get_audio_token_length`
22
+ return (input_length + 2 * padding - (kernel_size - 1) - 1) // stride + 1
23
24
25
def _as_list_chunk_counts(
vllm/model_executor/models/lfm2_vl.py
+3
-1
@@ -347,7 +347,9 @@ class Lfm2VLMultiModalProcessor(BaseMultiModalProcessor[Lfm2VLProcessingInfo]):
347
) -> BatchFeature:
348
# Text-only input not supported in composite processor
349
if not (images := mm_data.get("images", [])):
350
- prompt_ids = self.info.get_tokenizer().encode(prompt)
350
+ prompt_ids = self.info.get_tokenizer().encode(
351
+ prompt, add_special_tokens=False
352
+ )
353
prompt_ids = self._apply_hf_processor_tokens_only(prompt_ids)
354
return BatchFeature(dict(input_ids=[prompt_ids]), tensor_type="pt")
355
vllm/model_executor/models/qwen2_vl.py
+9
-5
@@ -1467,15 +1467,15 @@ class Tarsier2ImageProcessor(Qwen2VLImageProcessor):
1467
class Tarsier2Processor(Qwen2VLProcessor):
1468
def __init__(
1469
self,
1470
- vision_config: dict,
1470
+ image_processor: Tarsier2ImageProcessor,
1471
tokenizer: TokenizerLike,
1472
+ video_processor: Qwen2VLVideoProcessor,
1473
**kwargs,
1474
):
1474
- self.image_processor = Tarsier2ImageProcessor(**vision_config)
1475
super().__init__(
1476
- image_processor=self.image_processor,
1476
+ image_processor=image_processor,
1477
tokenizer=tokenizer,
1478
- video_processor=Qwen2VLVideoProcessor(**vision_config),
1478
+ video_processor=video_processor,
1479
chat_template=None,
1480
**kwargs,
1481
)
@@ -1489,8 +1489,12 @@ class Tarsier2ProcessingInfo(Qwen2VLProcessingInfo):
1489
return correct_config
1490
1491
def get_hf_processor(self, **kwargs: object) -> Tarsier2Processor:
1492
+ vision_config = self.ctx.get_hf_image_processor_config()
1493
+ image_processor = Tarsier2ImageProcessor(**vision_config)
1494
+ video_processor = Qwen2VLVideoProcessor(**vision_config)
1495
return Tarsier2Processor(
1493
- vision_config=self.ctx.get_hf_image_processor_config(),
1496
+ image_processor=image_processor,
1497
+ video_processor=video_processor,
1498
tokenizer=self.get_tokenizer(),
1499
**kwargs,
1500
)