Uh oh!
There was an error while loading. Please reload this page.
Introducing SentencePiece Unigram Tokenizer Model - #7390
Conversation
There was a problem hiding this comment.
Copilot reviewed 11 out of 14 changed files in this pull request and generated 1 comment.
Files not reviewed (3)
- THIRD-PARTY-NOTICES.TXT: Language not supported
- eng/Versions.props: Language not supported
- src/Microsoft.ML.Tokenizers/Model/CodeGenTokenizer.cs: Evaluated as low risk
Uh oh!
There was an error while loading. Please reload this page.
ericstj
left a comment
There was a problem hiding this comment.
Didn't dig too deep just a few small observations and suggestions.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
src/Microsoft.ML.Tokenizers/Normalizer/SentencePieceNormalizer.cs:392
- In this loop, calling sp.Slice(1) does not update the variable 'sp', which may result in an infinite loop if the condition remains true. Consider reassigning the sliced span to 'sp' (e.g., sp = sp.Slice(1)).
while (isPrevSpace && sp.Length > 0 && sp[0] == (byte)' ') { sp.Slice(1); }
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
luisquintanilla
left a comment
There was a problem hiding this comment.
Typo - SentencePieceUingramModel.cs should be SentencePieceUnigramModel.cs
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ericstj
left a comment
There was a problem hiding this comment.
Thank you for addressing feedback. This looks good to me. Please check if @michaelgsharp has feedback too.
Uh oh!
There was an error while loading. Please reload this page.
Fixes#7186
We have been supporting SentencePiece Bpe model for a while, the change here is introducing the support to the SentencePiece Unigram tokenizer model.
Users can create a tokenizer instance by using a code like the following:
Notes around the change
SentencePieceToknizer.csfile into a newly introduced fileSentencePieceBaseModel.csandSentencePieceBpeModel.cs. Most of the code in the newly introduced files are mostly not changed.SentencePieceUnigramModel.csfile.SentencePieceTokenizer.csto work with the model abstraction and automatically handle both models Bpe and Unigram.