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
55e6d3d5
Unverified
Commit
55e6d3d5
authored
Mar 16, 2026
by
Raushan Turganbay
Committed by
GitHub
Mar 16, 2026
Browse files
[Bugfix] Make siglip/clip compatible with transformers v5 (#37200)
Signed-off-by:
raushan
<
raushan@huggingface.co
>
parent
6682c231
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
tests/models/multimodal/pooling/test_clip.py
tests/models/multimodal/pooling/test_clip.py
+6
-2
tests/models/multimodal/pooling/test_siglip.py
tests/models/multimodal/pooling/test_siglip.py
+6
-2
No files found.
tests/models/multimodal/pooling/test_clip.py
View file @
55e6d3d5
...
...
@@ -2,6 +2,7 @@
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import
pytest
import
torch
from
transformers
import
CLIPModel
from
....conftest
import
IMAGE_ASSETS
,
HfRunner
,
PromptImageInput
,
VllmRunner
...
...
@@ -50,13 +51,16 @@ def _run_test(
if
"pixel_values"
in
inputs
:
pooled_output
=
hf_model
.
model
.
get_image_features
(
pixel_values
=
inputs
.
pixel_values
,
)
.
squeeze
(
0
)
)
else
:
pooled_output
=
hf_model
.
model
.
get_text_features
(
input_ids
=
inputs
.
input_ids
,
attention_mask
=
inputs
.
attention_mask
,
)
.
squeeze
(
0
)
)
if
not
isinstance
(
pooled_output
,
torch
.
Tensor
):
pooled_output
=
pooled_output
.
pooler_output
pooled_output
=
pooled_output
.
squeeze
(
0
)
all_outputs
.
append
(
pooled_output
.
tolist
())
hf_outputs
=
all_outputs
...
...
tests/models/multimodal/pooling/test_siglip.py
View file @
55e6d3d5
...
...
@@ -4,6 +4,7 @@
from
typing
import
Any
import
pytest
import
torch
from
transformers
import
SiglipModel
from
....conftest
import
IMAGE_ASSETS
,
HfRunner
,
PromptImageInput
,
VllmRunner
...
...
@@ -68,12 +69,15 @@ def _run_test(
if
"pixel_values"
in
inputs
:
pooled_output
=
hf_model
.
model
.
get_image_features
(
pixel_values
=
inputs
.
pixel_values
,
)
.
squeeze
(
0
)
)
else
:
pooled_output
=
hf_model
.
model
.
get_text_features
(
input_ids
=
inputs
.
input_ids
,
)
.
squeeze
(
0
)
)
if
not
isinstance
(
pooled_output
,
torch
.
Tensor
):
pooled_output
=
pooled_output
.
pooler_output
pooled_output
=
pooled_output
.
squeeze
(
0
)
all_outputs
.
append
(
pooled_output
.
tolist
())
hf_outputs
=
all_outputs
...
...
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