Skip to content

Commit

Permalink
Update optimum/habana/transformers/models/mt5/modeling_mt5.py
Browse files Browse the repository at this point in the history
Co-authored-by: Yaser Afshar <[email protected]>
  • Loading branch information
Gaurav7888 and yafshar authored Aug 5, 2024
1 parent aadea5a commit 72489fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion optimum/habana/transformers/models/mt5/modeling_mt5.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def gaudi_MT5Stack_forward(
else:
mask_seq_length = past_key_values[0][0].shape[2] + seq_length if past_key_values is not None else seq_length

if use_cache is True:
if use_cache:
if not self.is_decoder:
raise ValueError(f"`use_cache` can only be set to `True` if {self} is used as a decoder")

Expand Down

0 comments on commit 72489fe

Please sign in to comment.