[Bugfix][MiMo] Declare embedding_fields so an EPD pair can serve images (#58938)
Signed-off-by: Giulio De Pasquale <git@depasquale.giugl.io>
Giulio De Pasquale committed
Sep 29, 2026 at 16:33 UTC
8aaeef343a103bea13aadbbd55978df2c272744e
1 file changed
+20
-4
vllm/model_executor/models/mimo_v2_omni.py
+20
-4
@@ -69,7 +69,10 @@ from .qwen2_5_vl import (
69
Qwen2_5_VLVideoInputs,
70
Qwen2_5_VLVideoPixelInputs,
71
)
72
-from .qwen2_vl import _create_qwen2vl_field_factory
72
+from .qwen2_vl import (
73
+ Qwen2VLMultiModalDataParser,
74
+ _create_qwen2vl_field_factory,
75
+)
76
from .utils import AutoWeightsLoader, IntermediateTensors, WeightsMapper, maybe_prefix
77
78
@@ -670,6 +673,14 @@ class MiMoVisionTransformer(nn.Module):
673
return loader.load_weights(weights, mapper=self.hf_to_vllm_mapper)
674
675
676
+class MiMoV2OmniMultiModalDataParser(Qwen2VLMultiModalDataParser):
677
+ # Video stays raw: get_video_replacement also reads second_per_grid_ts and
678
+ # video_start_times, which a metadata-only rewrite would not carry.
679
+ embedding_fields = {
680
+ "image": Qwen2VLMultiModalDataParser.embedding_fields["image"],
681
+ }
682
+
683
+
684
class MiMoV2OmniProcessingInfo(BaseProcessingInfo):
685
def get_supported_mm_limits(self) -> Mapping[str, int | None]:
686
return {"audio": None, "image": None, "video": None}
@@ -689,9 +700,14 @@ class MiMoV2OmniProcessingInfo(BaseProcessingInfo):
700
return self.get_hf_processor(**kwargs).image_processor
701
702
def get_data_parser(self):
692
- from vllm.multimodal.parse import MultiModalDataParser
693
-
694
- return MultiModalDataParser(target_sr=24000.0)
703
+ # Without embedding_fields the EC producer publishes no metadata and
704
+ # the EPD proxy never rewrites the media item.
705
+ return MiMoV2OmniMultiModalDataParser(
706
+ self.get_hf_config().vision_config.spatial_merge_size,
707
+ target_sr=24000.0,
708
+ expected_hidden_size=self._get_expected_hidden_size(),
709
+ allow_missing_mm_embeddings=self.allow_missing_mm_embeddings,
710
+ )
711
712
def get_mm_max_tokens_per_item(
713
self,