Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
bf82c9b7
Unverified
Commit
bf82c9b7
authored
Jan 05, 2023
by
Younes Belkada
Committed by
GitHub
Jan 05, 2023
Browse files
[`BLIP`] Fix daily CI failing test (#20877)
parent
beb24f2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
tests/models/blip/test_modeling_blip.py
tests/models/blip/test_modeling_blip.py
+3
-3
No files found.
tests/models/blip/test_modeling_blip.py
View file @
bf82c9b7
...
...
@@ -853,7 +853,7 @@ class BlipModelIntegrationTest(unittest.TestCase):
out_itm
=
model
(
**
inputs
)
out
=
model
(
**
inputs
,
use_itm_head
=
False
)
expected_scores
=
torch
.
Tensor
([[
0.97
7
9
,
0.022
1
]])
expected_scores
=
torch
.
Tensor
([[
0.979
8
,
0.02
0
2
]])
self
.
assertTrue
(
torch
.
allclose
(
torch
.
nn
.
Softmax
()(
out_itm
[
0
].
cpu
()),
expected_scores
,
a
tol
=
1e-3
,
r
tol
=
1e-3
))
self
.
assertTrue
(
torch
.
allclose
(
out
[
0
].
cpu
(),
torch
.
Tensor
([[
0.5053
]]),
a
tol
=
1e-3
,
r
tol
=
1e-3
))
self
.
assertTrue
(
torch
.
allclose
(
torch
.
nn
.
Softmax
()(
out_itm
[
0
].
cpu
()),
expected_scores
,
r
tol
=
1e-3
,
a
tol
=
1e-3
))
self
.
assertTrue
(
torch
.
allclose
(
out
[
0
].
cpu
(),
torch
.
Tensor
([[
0.5053
]]),
r
tol
=
1e-3
,
a
tol
=
1e-3
))
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