Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
fix run_seq2seq.py; porting trainer tests to it #10162
fix run_seq2seq.py; porting trainer tests to it #10162
Changes from 1 commit
dea3645
9fa598b
bc27af9
7266393
d967d6a
89f12e1
5a1405a
f486afa
1715bea
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting that logic back. @patil-suraj @patrickvonplaten since you better than me, shouldn't this be done by
set_tgt_lang_special_tokens
inside mBART?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make a priority on merging this, so that I could finish porting the other tests? And this can be dealt with separately? This PR isn't introducing anything new. Only restoring what was there in first place.
I can open an issue so that it doesn't fall between the cracks.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set_tgt_lang_special_tokens
is a method onMBartTokenizer
so this needs to be done outside of the model.Also, IMO
MBartTokenizerFast
should also have thelang_code_to_id
attribute, not sure why it was treated differently.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I decided to go ahead and port the other scripts instead of waiting for merging of the first set.
Had to make some more fixes in the script while at it.
So no rush.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with @patil-suraj here -> IMO
MBartTokenizerFast
should have thelang_code_to_id
so that we don't need an if-else here...but this is not necessarily the responsibility of this PR, so it's fine for me as it isThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe for models such as MBart that don't have an unique
decoder_start_token_id
, we should maybe in the future just leaveconfig.decoder_start_token_id=None
and then throw an error / warning when generatingThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting it manually here
model.config.decoder_start_token_id
is the correct thing to do here, but not super pretty IMO -> it would be better to incentivize the user to either insert at init or when callinggenerate
But because of backward comp we can't really change it now for mBART anyways...