-
Notifications
You must be signed in to change notification settings - Fork 31.8k
🚨 🚨 🚨 Fix Issue 15003: SentencePiece Tokenizers Not Adding Special Tokens in convert_tokens_to_string
#15775
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
Merged
sgugger
merged 29 commits into
huggingface:main
from
beneyal:15003-albert-tokenizer-special-tokens
Nov 2, 2022
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
c0c15bb
Add test for SentencePiece not adding special tokens to strings
beneyal 08d47a7
Add SentencePieceStringConversionMixin to fix issue 15003
beneyal 6c82c09
Fix conversion from tokens to string for most SentencePiece tokenizers
beneyal 7bfe422
Fix MarianTokenizer, adjust SentencePiece test to accomodate vocab
beneyal cb4c824
Fix DebertaV2Tokenizer
beneyal e6795b9
Ignore LayoutXLMTokenizer in SentencePiece string conversion test
beneyal 17e0921
Run 'make style' and 'make quality'
beneyal c29bcdd
Clean convert_tokens_to_string test
beneyal e11cf2a
Remove commented out code
beneyal fb1c273
Improve robustness of convert_tokens_to_string test
beneyal 91413e5
Inline and remove SentencePieceStringConversionMixin
beneyal 0743ae0
Run 'make style' and 'make quality'
beneyal bad0f43
Revert removal of space in convert_tokens_to_string
beneyal 8cb264e
Remove redundant import
c14ebcb
Revert test text to original
f021c2d
Uncomment the lowercasing of the reverse_text variable
cee809c
Mimic Rust tokenizer behavior for tokenizers
beneyal adc06ff
Fix accidentally skipping test in wrong tokenizer
beneyal 6b3cd77
Add test for equivalent Rust and slow tokenizer behavior
beneyal e94d85e
Override _decode in BigBirdTokenizer to mimic Rust behavior
beneyal 3273b1a
Override _decode in FNetTokenizer to mimic Rust behavior
beneyal a89dba6
Override _decode in XLNetTokenizer to mimic Rust behavior
beneyal cb53d92
Merge 'main' into the 15003 fix branch
beneyal 205e133
Remove unused 're' import
beneyal c271a63
Update DebertaV2Tokenizer to mimic Rust tokenizer
beneyal 0a8c149
Merge branch 'main' of https://github.com/huggingface/transformers in…
beneyal 073b749
Deberta tokenizer now behaves like Albert and its `convert_tokens_to_…
beneyal 048bc65
Ignore problematic tests in Deberta V2
beneyal 21c3f6d
Add comment on why the Deberta V2 tests are skipped
beneyal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.
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.
I would propose to take the same solution as the tokenizer with a fast version because if we add a fast version later we will be blocked - and the decoding method is quite important for Bert generation. In general I think is easier to take the same behavior for all the tokenizers we are currently changing (and maybe replace the
rusttest by an hardcoded test).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.
You mean like, for example, the
convert_tokens_to_stringmethod inAlbertTokenizer?