Skip to content

fix(auto-model): align SentencePiece word markers - #3587

Merged
LauraGPT merged 1 commit into
mainfrom
codex/fix-sentencepiece-punc-alignment-3539
Aug 30, 2026
Merged

fix(auto-model): align SentencePiece word markers#3587
LauraGPT merged 1 commit into
mainfrom
codex/fix-sentencepiece-punc-alignment-3539

Conversation

@LauraGPT

Copy link
Copy Markdown
Collaborator

Summary

  • ignore the SentencePiece word-boundary marker while aligning ASR word timestamps with punctuation tokens
  • add a regression test covering punctuation-preserving sentence timestamps for marked words

Root cause

The reporter's mixed-language sample contains one timestamped word prefixed with . The visible ASR surface correctly omits that tokenizer marker, but _merge_timestamp_units compared it as transcript text. That single-character mismatch invalidated alignment for the whole recording, triggered the VAD-segment fallback, and discarded punctuation from sentence_info even though the top-level text contained 272 punctuation marks.

Validation

  • python -m pytest -q tests/test_punc_model_none.py tests/test_cli.py tests/test_generate_subtitle.py -> 45 passed
  • reporter's 633.651 s sample on exact head 83de4060de043f9ea0a0c318edc9a818c54f28d5:
    • 3,173 words and timestamps; the sole marker now aligns with the punctuation surface
    • sentence_info: 275 entries carrying all 272 predicted punctuation marks
    • readable SRT: 137 cues, maximum 7.94 s and 42 characters
  • 224.427 s comparison sample:
    • sentence_info: 153 entries carrying all 152 predicted punctuation marks
    • readable SRT: 53 cues, maximum 6.36 s and 42 characters

Related to #3539. This PR intentionally does not auto-close the issue; the reporter should confirm the fix on their workflow first.

Signed-off-by: LauraGPT <18321252+LauraGPT@users.noreply.github.com>
@LauraGPT
LauraGPT merged commit 0126901 into main Aug 30, 2026
1 check passed
@LauraGPT
LauraGPT deleted the codex/fix-sentencepiece-punc-alignment-3539 branch August 30, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant