Skip to content

Commit

Permalink
Pass missing arguments to `SeamlessM4Tv2ConformerEncoderLayer.forward…
Browse files Browse the repository at this point in the history
…()` when gradient checkpointing is enabled (huggingface#31945)

* pass missing arguments when gradient checkpointing is enabled for SeamlessM4Tv2

* fix same bug in SeamlessM4Tv1

* pass args, not kwargs
  • Loading branch information
anferico authored and zucchini-nlp committed Jul 24, 2024
1 parent fc42335 commit 0995c77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/transformers/models/seamless_m4t/modeling_seamless_m4t.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,8 @@ def forward(
hidden_states,
attention_mask,
relative_position_embeddings,
output_attentions,
conv_attention_mask,
)
else:
layer_outputs = layer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,8 @@ def forward(
layer.__call__,
hidden_states,
attention_mask,
output_attentions,
conv_attention_mask,
)
else:
layer_outputs = layer(
Expand Down

0 comments on commit 0995c77

Please sign in to comment.