"git@developer.sourcefind.cn:hehl2/torchaudio.git" did not exist on "9a013fdb1d7e3d529d6fd6e28198a4cb12ac3502"
Unverified Commit 77c3973e authored by Younes Belkada's avatar Younes Belkada Committed by GitHub
Browse files

[`Pix2Struct`] Fix pix2struct cross attention (#25200)

* fix pix2struct cross attention

* fix torchscript slow test
parent 4033ea71
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment