Skip to content

Commit

Permalink
add default to pop
Browse files Browse the repository at this point in the history
  • Loading branch information
gante committed Jul 21, 2022
1 parent db88b11 commit 8893aa2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/generation_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ def _validate_model_kwargs(self, model_kwargs: Dict[str, Any]):
# Excludes arguments that are handled before calling the any model function
if self.config.is_encoder_decoder:
for key in ["decoder_input_ids"]:
model_kwargs.pop(key)
model_kwargs.pop(key, None)

unused_model_args = []
model_args = set(inspect.signature(self.prepare_inputs_for_generation).parameters)
Expand Down

0 comments on commit 8893aa2

Please sign in to comment.