Repository navigation
Fix Qwen3 Japanese/Korean alignment and add opt-in overlap text trimming - #1350
Merged
Merged
Conversation
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.
Fixes #1349.
Japanese forced alignment previously grouped kana runs instead of using upstream's Nagisa segmentation, producing misleading word spans and gaps. Add native Nagisa word segmentation using existing framework LSTM, Linear, weight-loading and prepared-graph components. Korean now uses the official dictionary-backed splitting rule. Both language codes and full labels are accepted; ASR language handling is unchanged.
Tokenizer assets are declared through the existing model spec and can be bundled into F16/Q8 GGUFs. The exporter includes only Nagisa segmentation weights, not POS tagging. Repacking uses native storage to preserve all existing aligner tensors; Nagisa weights are added as F32. Older GGUFs remain usable: missing Japanese/Korean tokenizer assets select the legacy word splitter and emit a warning to download an updated GGUF or repack it. Present but invalid assets still raise an error. Other languages do not require these assets.
A separate opt-in request option,
trim_chunk_overlap=false, addresses repeated context in punctuated fixed-chunk transcripts. Withreturn_timestamps=true,preserve_punctuation=trueandtrim_chunk_overlap=true, text is selected using the existing retained-word timestamps while preserving its original punctuation. It does not deduplicate repeated strings, change ASR generation or alter word timestamps. Existing punctuation-preserving behavior remains selected when the option is omitted or false.Validation
Debug build, processor unit tests and model-spec checks passed.
Both corrected GGUFs preserve all 708 original tensors byte-for-byte, with unchanged shapes and storage types. The Q8 package retains 363 BF16, 344 Q8_0 and one F16 tensor. All 15 added Nagisa tensors are F32 and byte-identical to the export. Both packages also loaded and aligned Japanese/English on v0.9.5.
All 163 segmentation cases matched upstream exactly: 80 Japanese and 83 Korean.
On the reported 60-second Japanese clip, both F16 and Q8 produce the same 178 word units as official Python. Long units assigned less than 100 ms fell from 3 to 0. Timestamp agreement is not exact: maximum boundary difference versus Python is 400 ms.
A 5-second Japanese control matched all 30 timestamp boundaries; the Korean control matched all 31 word units, with a maximum timestamp difference of 80 ms.
English alignment matched the previous release. With old GGUFs, Japanese and Korean word timestamps matched v0.9.5 exactly, and both missing-asset warnings were verified. Japanese long→short→long reuse preserved words and timestamps.
CUDA fixed-chunk tests reproduced the reported repeated phrase. Enabling overlap trimming removed context repetition in Japanese and English while preserving word timestamps. Omitted/false output matched the saved baseline exactly; mixed-language repeated requests remained stable.
CPU and Vulkan both completed a 20-second Japanese clip crossing the fixed-chunk boundary with overlap trimming enabled: 57 valid, ordered word spans, identical text and timestamps across backends, and no duplicate of the reported phrase.
No framework, GGML, server-protocol or decoder-math changes.