Skip to content

Commit

Permalink
revert changes in models that don't currently support cross attention
Browse files Browse the repository at this point in the history
  • Loading branch information
Yossi Synett committed Oct 27, 2020
1 parent 56622d4 commit 741dc0d
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion examples/deebert/src/modeling_highway_bert.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def forward(
hidden_states = layer_outputs[0]

if self.output_attentions:
all_attentions = all_attentions + layer_outputs[1:]
all_attentions = all_attentions + (layer_outputs[1],)

current_outputs = (hidden_states,)
if self.output_hidden_states:
Expand Down
2 changes: 1 addition & 1 deletion src/transformers/modeling_longformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ def custom_forward(*inputs):
hidden_states = layer_outputs[0]

if output_attentions:
all_attentions = all_attentions + layer_outputs[1:]
all_attentions = all_attentions + (layer_outputs[1],)

# Add last layer
if output_hidden_states:
Expand Down
2 changes: 1 addition & 1 deletion src/transformers/modeling_mobilebert.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ def forward(
hidden_states = layer_outputs[0]

if output_attentions:
all_attentions = all_attentions + layer_outputs[1:]
all_attentions = all_attentions + (layer_outputs[1],)

# Add last layer
if output_hidden_states:
Expand Down
2 changes: 1 addition & 1 deletion src/transformers/modeling_tf_bert.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def call(
hidden_states = layer_outputs[0]

if output_attentions:
all_attentions = all_attentions + layer_outputs[1:]
all_attentions = all_attentions + (layer_outputs[1],)

# Add last layer
if output_hidden_states:
Expand Down
2 changes: 1 addition & 1 deletion src/transformers/modeling_tf_electra.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def call(
hidden_states = layer_outputs[0]

if output_attentions:
all_attentions = all_attentions + layer_outputs[1:]
all_attentions = all_attentions + (layer_outputs[1],)

# Add last layer
if output_hidden_states:
Expand Down
2 changes: 1 addition & 1 deletion src/transformers/modeling_tf_mobilebert.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ def call(
hidden_states = layer_outputs[0]

if output_attentions:
all_attentions = all_attentions + layer_outputs[1:]
all_attentions = all_attentions + (layer_outputs[1],)

# Add last layer
if output_hidden_states:
Expand Down
2 changes: 1 addition & 1 deletion src/transformers/modeling_tf_roberta.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def call(
hidden_states = layer_outputs[0]

if output_attentions:
all_attentions = all_attentions + layer_outputs[1:]
all_attentions = all_attentions + (layer_outputs[1],)

# Add last layer
if output_hidden_states:
Expand Down

0 comments on commit 741dc0d

Please sign in to comment.