From c912ba5f69a47396244c64deada5c2b8a258e2b8 Mon Sep 17 00:00:00 2001 From: Patrick von Platen Date: Mon, 19 Oct 2020 22:02:42 +0200 Subject: [PATCH] [EncoderDecoder] Fix Typo (#7915) * fix encoder decoder models * add .gitignore --- .gitignore | 3 +++ src/transformers/modeling_encoder_decoder.py | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index cb6316a6989dd6..b5d8fc1ecdd29c 100644 --- a/.gitignore +++ b/.gitignore @@ -157,3 +157,6 @@ debug.env #ctags tags + +# pre-commit +.pre-commit* diff --git a/src/transformers/modeling_encoder_decoder.py b/src/transformers/modeling_encoder_decoder.py index 9ce2467480834f..ea4044d102a7d7 100644 --- a/src/transformers/modeling_encoder_decoder.py +++ b/src/transformers/modeling_encoder_decoder.py @@ -434,8 +434,6 @@ def forward( encoder_attentions=encoder_outputs.attentions, ) - return decoder_outputs + encoder_outputs - def prepare_inputs_for_generation(self, input_ids, past, attention_mask, encoder_outputs, **kwargs): decoder_inputs = self.decoder.prepare_inputs_for_generation(input_ids) decoder_attention_mask = decoder_inputs["attention_mask"] if "attention_mask" in decoder_inputs else None