Repository navigation
Conversation
|
Hi, I’d like to help validate this change. The escaping approach looks important for preserving literal transcript text in WebVTT without affecting highlighting, wrapping, or SRT output. Would it be helpful if I reviewed the diff and tested additional edge cases, particularly HTML entities, ampersands, and word-level timestamps, to ensure the output is escaped correctly without double escaping? I’ll coordinate with the existing contributor to avoid duplicating work. |
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.
Whisper writes transcript text directly into WebVTT cue payloads. A literal
<name>is interpreted as a tag, and literal<is interpreted as a character reference, changing what a player displays. Escape the transcript text before emitting VTT cues, following the WebVTT cue-text rules.Escape words after line wrapping and before adding the writer's own
<u>highlighting. This covers ordinary cues, highlighted cues, and gaps between words without double escaping. Segment text uses the same VTT-specific hook; SRT output remains unchanged.Tests cover literal tags/entities, ampersands, ordinary text, highlighting and gaps, wrapping based on unescaped text, and unchanged input dictionaries. Against unchanged production code, seven new cases fail and five controls pass.
Validation on Windows CPU, Python 3.12.5, PyTorch 2.11.0+cpu:
python -m pytest -q tests --ignore=tests/test_transcribe.py -m 'not requires_cuda': 29 passed, 8 deselected.git diff --checkpass. Black ran under Python 3.12.14.Related: #2847 handles timestamp arrows. This change addresses literal markup/entity text; word-level
-->also becomes-->in VTT source, preserving its displayed arrow. Existing segment-level arrow replacement is retained.Model-inference and CUDA tests were not run.