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
aecbcb36
Unverified
Commit
aecbcb36
authored
Apr 03, 2023
by
zhbh01
Committed by
GitHub
Apr 03, 2023
Browse files
[BLIP] fix cross attentions for BlipTextEncoder (#22515)
parent
4e441e52
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
src/transformers/models/blip/modeling_blip_text.py
src/transformers/models/blip/modeling_blip_text.py
+1
-0
No files found.
src/transformers/models/blip/modeling_blip_text.py
View file @
aecbcb36
...
@@ -445,6 +445,7 @@ class BlipTextEncoder(nn.Module):
...
@@ -445,6 +445,7 @@ class BlipTextEncoder(nn.Module):
next_decoder_cache
+=
(
layer_outputs
[
-
1
],)
next_decoder_cache
+=
(
layer_outputs
[
-
1
],)
if
output_attentions
:
if
output_attentions
:
all_self_attentions
=
all_self_attentions
+
(
layer_outputs
[
1
],)
all_self_attentions
=
all_self_attentions
+
(
layer_outputs
[
1
],)
all_cross_attentions
=
all_cross_attentions
+
(
layer_outputs
[
2
],)
if
output_hidden_states
:
if
output_hidden_states
:
all_hidden_states
=
all_hidden_states
+
(
hidden_states
,)
all_hidden_states
=
all_hidden_states
+
(
hidden_states
,)
...
...
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