Skip to content

Commit

Permalink
make fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
Rocketknight1 committed May 10, 2023
1 parent 9c573aa commit 6bc65d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/transformers/modeling_tf_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1256,12 +1256,12 @@ def serving_output(self, output):
Prepare the output of the saved model. Can be overridden if specific serving modifications are required.
"""
if isinstance(output, ModelOutput):
if 'hidden_states' in output:
if "hidden_states" in output:
try:
output.hidden_states = tf.convert_to_tensor(output.hidden_states)
except ValueError:
pass # Layers may not have the same dimensions
if 'attentions' in output:
if "attentions" in output:
try:
output.attentions = tf.convert_to_tensor(output.attentions)
except ValueError:
Expand Down

0 comments on commit 6bc65d1

Please sign in to comment.