Skip to content

Commit 5170e9d

Browse files
committed
Update utils.py
1 parent 4984f7b commit 5170e9d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/transformers/generation/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,7 @@ def prepare_inputs_for_generation(
656656
if causal_mask_creation_function is None: # can't be found
657657
output_attentions = kwargs.get("output_attentions", False)
658658
token_type_ids = getattr(model_input, "token_type_ids", None)
659+
# Some models may overwrite the general one
659660
causal_mask_creation_function = getattr(self, "create_masks_for_generate", create_masks_for_generate)
660661
attention_mask = causal_mask_creation_function(
661662
config=self.config,

0 commit comments

Comments
 (0)