-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Complete merge Seq-2-Seq generation into default generation #3225
Complete merge Seq-2-Seq generation into default generation #3225
Conversation
f5a6bd0
to
6047f46
Compare
Codecov Report
@@ Coverage Diff @@
## master #3225 +/- ##
=========================================
+ Coverage 77.93% 78.03% +0.1%
=========================================
Files 98 98
Lines 16666 16668 +2
=========================================
+ Hits 12988 13007 +19
+ Misses 3678 3661 -17
Continue to review full report at Codecov.
|
Another issue that came up today from @yjernite, Bart does not support |
|
I prefer option #3, it looks like very little code and the best metrics. |
done :-) |
Linked to PR: #3264 |
This one is ok for me. Also, I guess we could default to |
Yeah currently option 3 is implemented. |
Yeah I'd love to merge this! Having trouble connecting to brutasse to run rouge, but afaict it will be the same as pre 3140 :) |
Good to merge for me! IMPORNTANT:
have to be updated on AWS to pass all slow tests. All |
Ok merging. I let you continue in other PRs and ping me. |
Changed the configs on AWS. All slow tests pass now. |
This is a follow-up PR to finalize #3140 .
There was still no conclusion on how to handle the fairseq tricks for generation. To summarize:
I think we have three options:
generate()
which is calleddecoder_start_token_id=bos_token_id
, but can be overriden to be theeos_token_id
in the case of Bart. Here the ROUGE score is: 21.072ROUGE scores from @sshleifer
For comparison:
UPDATE:
Given the above scores, option 1. was chosen for the moment to have the same scores as fairseq.
This means that we have to start the decoder ids with a EOS token (which might be weird and fairseq specific). Therefore, a new argument
decoder_start_token_id
was added to the generate function that defaults to thebos_token_id
. When using Bart generate this argument should be set to theeos_token_id
to have good results. To see howBart.generate()
should be used take a look at:transformers/tests/test_modeling_bart.py
Line 470 in 2e81b9d
At the moment option 2. is implemented which seems to give the worst results and is also not the cleanest option.
This PR implements option 3.
For me either option 1. or option 3. is fine. Up to discuss @thomwolf , @julien-c , @LysandreJik @sshleifer