Skip to content

Commit

Permalink
fix encoder outputs (huggingface#8368)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickvonplaten authored and fabiocapsouza committed Nov 15, 2020
1 parent b390ebd commit 54d6a69
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/transformers/generation_tf_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,7 @@ def generate(
shape=(-1,),
)
# expand encoder_outputs
encoder_outputs = (tf.gather(encoder_outputs[0], expanded_batch_idxs, axis=0), *encoder_outputs[1:])

encoder_outputs = (tf.gather(encoder_outputs[0], expanded_batch_idxs, axis=0),)
else:
encoder_outputs = None
cur_len = shape_list(input_ids)[-1]
Expand Down

0 comments on commit 54d6a69

Please sign in to comment.