Skip to content
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

Unify the spm/bpe tokenizers #666

Merged
merged 7 commits into from
Mar 6, 2024
Merged

Unify the spm/bpe tokenizers #666

merged 7 commits into from
Mar 6, 2024

Conversation

wenbingl
Copy link
Member

@wenbingl wenbingl commented Mar 1, 2024

#561 fixed

@wenbingl wenbingl marked this pull request as ready for review March 2, 2024 01:00
@wenbingl wenbingl requested a review from a team as a code owner March 2, 2024 01:01
Copy link
Contributor

@sayanshaw24 sayanshaw24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good. My only comment is that KernelBpeTokenizer::SpmTokenize does not support fairseq or computing instance indices at the moment.

But I noticed you added the SPM implementation to bpe_kernels.cc but did not delete sentencepiece_tokenizer.cc, sentencepiece_tokenizer.hpp, or sentencepiece_decoder.hpp. I assume we will do this in the future as that is the main incentive of this unification, and when we do, we can also take care of the remaining SPM stuff (fairseq and instance indices) in the bpe source.

@wenbingl
Copy link
Member Author

wenbingl commented Mar 6, 2024

All looks good. My only comment is that KernelBpeTokenizer::SpmTokenize does not support fairseq or computing instance indices at the moment.

But I noticed you added the SPM implementation to bpe_kernels.cc but did not delete sentencepiece_tokenizer.cc, sentencepiece_tokenizer.hpp, or sentencepiece_decoder.hpp. I assume we will do this in the future as that is the main incentive of this unification, and when we do, we can also take care of the remaining SPM stuff (fairseq and instance indices) in the bpe source.

There will be a transition period. The old sentencepiece tokenizer code needs to be kept for Custom-Op backward compatibility. The faireseq indices will be added in the future.

@wenbingl wenbingl merged commit 61369fb into main Mar 6, 2024
43 checks passed
@wenbingl wenbingl deleted the spm2 branch March 6, 2024 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants