Skip to content

Commit

Permalink
output.keys() -> output
Browse files Browse the repository at this point in the history
  • Loading branch information
Rocketknight1 committed May 24, 2023
1 parent 05f7584 commit 52e5b6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/modeling_tf_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ def serving_output(self, output):
"""
if not isinstance(output, ModelOutput):
return output
for key in output.keys():
for key in output:
if key.endswith("hidden_states") and not getattr(self.config, "output_hidden_states", False):
output[key] = None
elif key.endswith("attentions") and not getattr(self.config, "output_attentions", False):
Expand Down

0 comments on commit 52e5b6b

Please sign in to comment.