Closed ydshieh closed 2 years ago
@ydshieh - thanks for the PR!
Tiny feedback, when we format code you use:
class Example:
instead of
class Example:
it's a bit easier to quickly read the code this way.
@patrickvonplaten I will take a look of this issue if you haven't been able to find the time on it.
I think it would be great if we can fix this before the next release which will have exciting news about TF generate :-).
This would be amazing if you find a bit of time for it @ydshieh
Fixed by #17426 by the changes in generation_tf_utils.py
is_pad_token_not_equal_to_eos_token_id = (eos_token_id is None) or (
(eos_token_id is not None) and (pad_token_id != eos_token_id)
)
Environment info
transformers
version: 4.17.0.dev0Information
TFEncoderDecoderModel.generate()
forydshieh/bert2bert-cnn_dailymail-fp16
gives different results after #15562, see below.To reproduce
PT
On both commit
a3dbbc346
and2e12b907a
, this givessae was founded in 1856, ...
TF
a3dbbc346
:sae was founded in 1856,
(same as the PyTorch version)2e12b907a
:sae's national chapter suspended students, ...
Who can help
@patrickvonplaten (generate)