diff --git a/tests/model_executor/models/minicpmo_4_5/test_minicpmo_4_5_omni_llm_embed.py b/tests/model_executor/models/minicpmo_4_5/test_minicpmo_4_5_omni_llm_embed.py new file mode 100644 index 000000000..9f53fb7ec --- /dev/null +++ b/tests/model_executor/models/minicpmo_4_5/test_minicpmo_4_5_omni_llm_embed.py @@ -0,0 +1,33 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: Copyright contributors to the vLLM project + +import pytest + +from vllm_omni.model_executor.models.minicpmo_4_5.minicpmo_4_5_omni_llm import ( + MiniCPMO45OmniLLMForConditionalGeneration, +) + +pytestmark = [pytest.mark.core_model, pytest.mark.cpu] + + +def test_embed_multimodal_delegates_to_get_multimodal_embeddings(monkeypatch): + """vLLM V1 encoder profiling calls embed_multimodal; without an override the + SupportsMultiModal protocol stub returns None and startup fails downstream.""" + sentinel = (object(),) + seen: dict[str, object] = {} + + def fake_get_multimodal_embeddings(self, **kwargs): + seen.update(kwargs) + return sentinel + + monkeypatch.setattr( + MiniCPMO45OmniLLMForConditionalGeneration, + "get_multimodal_embeddings", + fake_get_multimodal_embeddings, + ) + model = object.__new__(MiniCPMO45OmniLLMForConditionalGeneration) + + out = model.embed_multimodal(pixel_values="pv", audio_features="af") + + assert out is sentinel + assert seen == {"pixel_values": "pv", "audio_features": "af"} diff --git a/vllm_omni/model_executor/models/minicpmo_4_5/minicpmo_4_5_omni_llm.py b/vllm_omni/model_executor/models/minicpmo_4_5/minicpmo_4_5_omni_llm.py index d70bc30d0..6d1c5de32 100644 --- a/vllm_omni/model_executor/models/minicpmo_4_5/minicpmo_4_5_omni_llm.py +++ b/vllm_omni/model_executor/models/minicpmo_4_5/minicpmo_4_5_omni_llm.py @@ -4580,6 +4580,10 @@ class MiniCPMO45OmniLLMForConditionalGeneration(nn.Module, SupportsMultiModal, S multimodal_embeddings += tuple(audio_embeddings) return multimodal_embeddings + def embed_multimodal(self, **kwargs: object) -> MultiModalEmbeddings: + """vLLM V1 encoder profiling calls this; the inherited Protocol stub returns None.""" + return self.get_multimodal_embeddings(**kwargs) + def get_input_embeddings( self, input_ids: torch.Tensor,