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
77c3973e
Unverified
Commit
77c3973e
authored
Aug 01, 2023
by
Younes Belkada
Committed by
GitHub
Aug 01, 2023
Browse files
[`Pix2Struct`] Fix pix2struct cross attention (#25200)
* fix pix2struct cross attention * fix torchscript slow test
parent
4033ea71
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
src/transformers/models/pix2struct/modeling_pix2struct.py
src/transformers/models/pix2struct/modeling_pix2struct.py
+3
-2
No files found.
src/transformers/models/pix2struct/modeling_pix2struct.py
View file @
77c3973e
...
...
@@ -1547,8 +1547,9 @@ class Pix2StructTextModel(Pix2StructPreTrainedModel):
present_key_value_states
=
present_key_value_states
+
(
present_key_value_state
,)
if
output_attentions
:
all_attentions
=
all_attentions
+
(
layer_outputs
[
2
],)
all_cross_attentions
=
all_cross_attentions
+
(
layer_outputs
[
3
],)
all_attentions
=
all_attentions
+
(
layer_outputs
[
3
],)
if
encoder_hidden_states
is
not
None
:
all_cross_attentions
=
all_cross_attentions
+
(
layer_outputs
[
5
],)
hidden_states
=
self
.
final_layer_norm
(
hidden_states
)
hidden_states
=
self
.
dropout
(
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