Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/models/supported_models.md
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ See [this page](#generative-models) for more information on how to use generativ
* `mistralai/Mistral-Small-3.1-24B-Instruct-2503`, etc.
*
* ✅︎
*
* ✅︎
- * `MllamaForConditionalGeneration`
* Llama 3.2
* T + I<sup>+</sup>
Expand Down
15 changes: 9 additions & 6 deletions vllm/model_executor/models/mistral3.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
from vllm.multimodal.profiling import BaseDummyInputsBuilder, ProcessorInputs
from vllm.sequence import IntermediateTensors

from .interfaces import (MultiModalEmbeddings, SupportsMultiModal, SupportsPP,
SupportsV0Only)
from .interfaces import MultiModalEmbeddings, SupportsMultiModal, SupportsPP
from .pixtral import PixtralHFEncoderInfo, PixtralHFVisionModel
from .utils import (AutoWeightsLoader, flatten_bn, init_vllm_registered_model,
maybe_prefix, merge_multimodal_embeddings)
from .vision import get_vision_encoder_info, select_patch_features
from .vision import (get_vision_encoder_info, scatter_patch_features,
select_patch_features)


class Mistral3ImagePixelInputs(TypedDict):
Expand Down Expand Up @@ -425,7 +425,7 @@ def init_vision_tower_for_llava(
info=_build_mistral3_info,
dummy_inputs=Mistral3DummyInputsBuilder)
class Mistral3ForConditionalGeneration(nn.Module, SupportsMultiModal,
SupportsPP, SupportsV0Only):
SupportsPP):

packed_modules_mapping = {
"qkv_proj": ["q_proj", "k_proj", "v_proj"],
Expand Down Expand Up @@ -518,7 +518,7 @@ def _parse_and_validate_image_input(
return Mistral3ImagePixelInputs(
type="pixel_values_pixtral",
pixel_values=flatten_bn(pixel_values),
embed_is_patch=embed_is_patch,
embed_is_patch=flatten_bn(embed_is_patch),
)

def _process_image_input(
Expand Down Expand Up @@ -557,7 +557,10 @@ def get_multimodal_embeddings(

vision_embeddings = self._process_image_input(image_input)

return vision_embeddings
return scatter_patch_features(
vision_embeddings,
image_input["embed_is_patch"],
)

def get_input_embeddings(
self,
Expand Down