-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
dea3645
fix run_seq2seq.py; porting DeepSpeed tests to it
stas00 9fa598b
unrefactor
stas00 bc27af9
Merge remote-tracking branch 'origin/master' into ds-tests-emergency
stas00 7266393
defensive programming
stas00 d967d6a
defensive programming 2
stas00 89f12e1
port the rest of the trainer tests
stas00 5a1405a
style
stas00 f486afa
a cleaner scripts dir finder
stas00 1715bea
cleanup
stas00 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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...