Repository navigation
Conversation
The default --suppress_tokens=-1 extends tokenizer.non_speech_tokens, which included 「」『』. Those are ordinary Chinese and Japanese quotation marks, not speaker tags or non-speech annotations, so every CLI run silently dropped the quotes from the transcript. Keep the symbols that actually mark non-speech.
Author
|
补充一句冲突提示:#2828 也在改 |
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.
What
--suppress_tokensdefaults to-1, anddecoding.pyturns that intotokenizer.non_speech_tokens. That set included「」『』:Those are ordinary Chinese and Japanese quotation marks, not speaker tags or non-speech annotations, so every CLI run (and every API call leaving
suppress_tokensat its default) silently dropped them from the transcript. A sentence likecame back as
他说:这个方案可以。— the quotes are gone, which makes Chinese output look like it lost text.Change
Remove the four CJK brackets from the suppression list. Everything that actually marks non-speech (
♪,#,(,),*, the speaker-tag shapes, …) is untouched.How I checked
Appended to
tests/test_tokenizer.py:「」『』must not be innon_speech_tokensfor azhtokenizer;♪,#,(,),*must still be suppressed, so the set keeps doing its job.Both use the real multilingual tokenizer from
whisper/assets, so no model or audio is needed. I verified the before/after behaviour with a standalone harness that loadswhisper/tokenizer.pydirectly (importing thewhisperpackage pulls in torch, which I do not have installed locally); the tests themselves run in this repo's CI.Related
#2878 (the other CJK issue I hit:
--max_line_widthcounting code points instead of display columns) touches a different file.