Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
f021b979
Unverified
Commit
f021b979
authored
Apr 02, 2025
by
Michael Goin
Committed by
GitHub
Apr 02, 2025
Browse files
[V1] Support Mistral3 in V1 (#15950)
Signed-off-by:
mgoin
<
mgoin64@gmail.com
>
parent
1cab43c2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
docs/source/models/supported_models.md
docs/source/models/supported_models.md
+1
-1
vllm/model_executor/models/mistral3.py
vllm/model_executor/models/mistral3.py
+9
-6
No files found.
docs/source/models/supported_models.md
View file @
f021b979
...
...
@@ -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>
...
...
vllm/model_executor/models/mistral3.py
View file @
f021b979
...
...
@@ -31,12 +31,12 @@ from vllm.multimodal.processing import (BaseMultiModalProcessor,
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
):
...
...
@@ -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"
],
...
...
@@ -518,7 +518,7 @@ class Mistral3ForConditionalGeneration(nn.Module, SupportsMultiModal,
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
(
...
...
@@ -557,7 +557,10 @@ class Mistral3ForConditionalGeneration(nn.Module, SupportsMultiModal,
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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment