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
cb3f2d8d
Unverified
Commit
cb3f2d8d
authored
Apr 27, 2025
by
Michael Goin
Committed by
GitHub
Apr 27, 2025
Browse files
[Bugfix] Fix Mistral3 spatial merge error (#17270)
Signed-off-by:
mgoin
<
mgoin64@gmail.com
>
parent
c12df53b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
vllm/model_executor/models/mistral3.py
vllm/model_executor/models/mistral3.py
+3
-0
vllm/model_executor/models/pixtral.py
vllm/model_executor/models/pixtral.py
+2
-3
No files found.
vllm/model_executor/models/mistral3.py
View file @
cb3f2d8d
...
@@ -272,6 +272,9 @@ class Mistral3MultiModalProcessor(
...
@@ -272,6 +272,9 @@ class Mistral3MultiModalProcessor(
vision_config
=
hf_config
.
vision_config
vision_config
=
hf_config
.
vision_config
assert
isinstance
(
vision_config
,
PixtralVisionConfig
)
assert
isinstance
(
vision_config
,
PixtralVisionConfig
)
# Need to sneak in spatial_merge_size for Mistral3
vision_config
.
spatial_merge_size
=
getattr
(
hf_config
,
"spatial_merge_size"
,
1
)
encoder_info
=
PixtralHFEncoderInfo
(
vision_config
)
encoder_info
=
PixtralHFEncoderInfo
(
vision_config
)
def
get_replacement
(
item_idx
:
int
):
def
get_replacement
(
item_idx
:
int
):
...
...
vllm/model_executor/models/pixtral.py
View file @
cb3f2d8d
...
@@ -911,9 +911,8 @@ class PixtralHFEncoderInfo(VisionEncoderInfo[PixtralVisionConfig]):
...
@@ -911,9 +911,8 @@ class PixtralHFEncoderInfo(VisionEncoderInfo[PixtralVisionConfig]):
return
self
.
vision_config
.
image_size
return
self
.
vision_config
.
image_size
def
get_patch_size
(
self
)
->
int
:
def
get_patch_size
(
self
)
->
int
:
spatial_merge_size
=
getattr
(
self
.
vision_config
,
"spatial_merge_size"
,
return
(
self
.
vision_config
.
patch_size
*
1
)
self
.
vision_config
.
spatial_merge_size
)
return
(
self
.
vision_config
.
patch_size
*
spatial_merge_size
)
def
get_patch_grid_length
(
self
)
->
int
:
def
get_patch_grid_length
(
self
)
->
int
:
image_size
,
patch_size
=
self
.
get_image_size
(),
self
.
get_patch_size
()
image_size
,
patch_size
=
self
.
get_image_size
(),
self
.
get_patch_size
()
...
...
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