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
0eebd748
Unverified
Commit
0eebd748
authored
May 27, 2025
by
Lukas Geiger
Committed by
GitHub
May 27, 2025
Browse files
[Model][Gemma3] Simplify image input validation (#18710)
Signed-off-by:
Lukas Geiger
<
lukas.geiger94@gmail.com
>
parent
27bebcd8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
vllm/model_executor/models/gemma3_mm.py
vllm/model_executor/models/gemma3_mm.py
+6
-12
No files found.
vllm/model_executor/models/gemma3_mm.py
View file @
0eebd748
...
@@ -504,18 +504,12 @@ class Gemma3ForConditionalGeneration(nn.Module, SupportsMultiModal, SupportsPP,
...
@@ -504,18 +504,12 @@ class Gemma3ForConditionalGeneration(nn.Module, SupportsMultiModal, SupportsPP,
return
next
(
self
.
parameters
()).
dtype
return
next
(
self
.
parameters
()).
dtype
def
_validate_pixel_values
(
self
,
data
:
torch
.
Tensor
)
->
torch
.
Tensor
:
def
_validate_pixel_values
(
self
,
data
:
torch
.
Tensor
)
->
torch
.
Tensor
:
h
=
w
=
self
.
config
.
vision_config
.
image_size
image_size
=
self
.
config
.
vision_config
.
image_size
expected_dims
=
(
3
,
h
,
w
)
expected_dims
=
(
3
,
image_size
,
image_size
)
if
data
.
shape
[
1
:]
!=
expected_dims
:
def
_validate_shape
(
d
:
torch
.
Tensor
):
if
d
.
shape
!=
expected_dims
:
raise
ValueError
(
raise
ValueError
(
"The expected shape of pixel values per image per batch "
"The expected shape of pixel values per image per batch is "
f
"is
{
expected_dims
}
. You supplied
{
tuple
(
d
.
shape
)
}
."
)
f
"
{
expected_dims
}
. You supplied
{
tuple
(
data
.
shape
)
}
."
)
for
d
in
data
:
_validate_shape
(
d
)
return
data
return
data
def
_parse_and_validate_image_input
(
def
_parse_and_validate_image_input
(
...
...
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