|
31 | 31 | from vllm.multimodal.profiling import BaseDummyInputsBuilder, ProcessorInputs
|
32 | 32 | from vllm.sequence import IntermediateTensors
|
33 | 33 |
|
34 |
| -from .interfaces import (MultiModalEmbeddings, SupportsMultiModal, SupportsPP, |
35 |
| - SupportsV0Only) |
| 34 | +from .interfaces import MultiModalEmbeddings, SupportsMultiModal, SupportsPP |
36 | 35 | from .pixtral import PixtralHFEncoderInfo, PixtralHFVisionModel
|
37 | 36 | from .utils import (AutoWeightsLoader, flatten_bn, init_vllm_registered_model,
|
38 | 37 | maybe_prefix, merge_multimodal_embeddings)
|
39 |
| -from .vision import get_vision_encoder_info, select_patch_features |
| 38 | +from .vision import (get_vision_encoder_info, scatter_patch_features, |
| 39 | + select_patch_features) |
40 | 40 |
|
41 | 41 |
|
42 | 42 | class Mistral3ImagePixelInputs(TypedDict):
|
@@ -425,7 +425,7 @@ def init_vision_tower_for_llava(
|
425 | 425 | info=_build_mistral3_info,
|
426 | 426 | dummy_inputs=Mistral3DummyInputsBuilder)
|
427 | 427 | class Mistral3ForConditionalGeneration(nn.Module, SupportsMultiModal,
|
428 |
| - SupportsPP, SupportsV0Only): |
| 428 | + SupportsPP): |
429 | 429 |
|
430 | 430 | packed_modules_mapping = {
|
431 | 431 | "qkv_proj": ["q_proj", "k_proj", "v_proj"],
|
@@ -518,7 +518,7 @@ def _parse_and_validate_image_input(
|
518 | 518 | return Mistral3ImagePixelInputs(
|
519 | 519 | type="pixel_values_pixtral",
|
520 | 520 | pixel_values=flatten_bn(pixel_values),
|
521 |
| - embed_is_patch=embed_is_patch, |
| 521 | + embed_is_patch=flatten_bn(embed_is_patch), |
522 | 522 | )
|
523 | 523 |
|
524 | 524 | def _process_image_input(
|
@@ -557,7 +557,10 @@ def get_multimodal_embeddings(
|
557 | 557 |
|
558 | 558 | vision_embeddings = self._process_image_input(image_input)
|
559 | 559 |
|
560 |
| - return vision_embeddings |
| 560 | + return scatter_patch_features( |
| 561 | + vision_embeddings, |
| 562 | + image_input["embed_is_patch"], |
| 563 | + ) |
561 | 564 |
|
562 | 565 | def get_input_embeddings(
|
563 | 566 | self,
|
|
0 commit comments