Repository navigation
Conversation
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
SentencepiecesTokenizer.ids2tokensinterprets model output IDs using SentencePiece's internal ordering even when a differenttoken_listwas supplied. The published English Paraformer model has 10,020 model tokens and 10,000 BPE pieces with different ordering, producing unrelated words.Delegate to
BaseTokenizer.ids2tokenswhen a vocabulary exists, preserving pieces and word-boundary markers fortokens2text. Keep the existing decode fallback when no vocabulary was supplied.encode,decode, and the SenseVoice postprocessor are unchanged. Add 19 offline regression cases and wire them into the existing CPU workflow.Related: #3780.
Validation
97ce0bc9b0178aac03008c3afe8271cdb534228fand its official 2.225-second English sample:procedure telegram impatience phuket sleeping danielot probecomeshe tried to think how it could be. All eight predicted IDs are identical before/after; all 956 loaded checkpoint entries were independently verified. No remote code was enabled.User impact and review notes
With a supplied vocabulary,
ids2tokensnow returns a piece list instead of decoded text. Callers requiring text should usetokens2text; without a vocabulary, legacy decoding remains unchanged. Please review this return-type correction and whether a migration note is needed.Real-model evidence covers one unique official audio sample, downloaded from two matching public sources. No GPU, full accuracy benchmark, real SenseVoice checkpoint, or hosted CI validation was performed. Local NumPy 2 testing used 2.4.6 because 2.4.0 is yanked; the upstream CI matrix is unchanged.
Prepared with OpenAI Codex assistance.