You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SentencepiecesTokenizer.ids2tokens ignores token_list - root cause of the paraformer-en gibberish in #3040 #3780
Summary iic/speech_paraformer-large-vad-punc_asr_nat-en-16k-common-vocab10020 is not mispackaged. The model predicts the right token ids; the text goes wrong at decoding. SentencepiecesTokenizer.ids2tokens ignores the loaded token_list (tokens.json) and decodes the ids with the BPE model's own id order. For this model the two orders differ, so every word is replaced by an unrelated one. Decoding the same ids through tokens.json gives correct English.
Environment
FunASR 1.4.16 (same code on current main), torch 2.14.1, Python 3.11, macOS arm64, CPU.
Root cause funasr/tokenizer/sentencepiece_tokenizer.py:
I would like to investigate and work on this. I would keep the scope to respecting the supplied token_list in ids2tokens, preserving the existing fallback when no list is supplied, and checking compatibility with current callers. I plan to start with offline CPU regression tests using a deliberately reordered vocabulary and a small SentencePiece fixture, including the unchanged-order case. I have not reproduced this locally yet; tokenizer tests alone would not establish the real-model transcription fix, so I would separately check the published sample and model artifacts before making that claim. Please let me know if someone is already working on this or if you prefer a different scope.
Activity
carey-bk commentedon Oct 19, 2026
I would like to investigate and work on this. I would keep the scope to respecting the supplied token_list in ids2tokens, preserving the existing fallback when no list is supplied, and checking compatibility with current callers. I plan to start with offline CPU regression tests using a deliberately reordered vocabulary and a small SentencePiece fixture, including the unchanged-order case. I have not reproduced this locally yet; tokenizer tests alone would not establish the real-model transcription fix, so I would separately check the published sample and model artifacts before making that claim. Please let me know if someone is already working on this or if you prefer a different scope.