Repository navigation
feat(asr): word timings only for the clips that ship - #214
Open
stephanvoytov wants to merge 1 commit into
Open
stephanvoytov wants to merge 1 commit into
stephanvoytov wants to merge 1 commit into
Conversation
A long source used to be transcribed with word timestamps in full even though only the delivered clips need them. With ASR_CLIP_WORDS the source pass is text-only (or the source YouTube captions) and each selected clip gets one word-level pass; caption_words then drive burned captions, re-styling, hook grounding, the Remotion preview and the editor EDL. - ASR_CLIP_WORDS / USE_SOURCE_CAPTIONS / SOURCE_CAPTIONS_LANG - shared youtube_captions module: the pipeline no longer imports free_tools (and its cloud hook) - per-pass reasoning effort and the OpenCode Go session header - tests and docs
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.
Summary
Two-pass ASR for long sources, plus reuse of the captions a YouTube source already has.
Why
The clip pipeline transcribed the whole source with word-level timestamps, although only the delivered clips need them. On a 42-minute source the source pass was the dominant cost. With this change the source pass is text-only (or the captions YouTube already serves) and each selected clip gets one word-level pass.
What changed
ASR_CLIP_WORDS=1: the source transcript is requested without word timings;_process_one_cliprefines each cut clip, storescaption_words, and captions, re-styling, hook grounding, the Remotion preview and the editor EDL use them. With no words on the source pass, clip cuts snap to segment boundaries.USE_SOURCE_CAPTIONS=1+SOURCE_CAPTIONS_LANG: read the source's own YouTube captions (json3) through a shared, dependency-lightyoutube_captionsmodule. A requested language that YouTube cannot serve falls back to ASR instead of feeding a translated track to the model. Early-audio ASR is skipped when captions can be used.LLM_SCORE_REASONING_EFFORT/LLM_DETAIL_REASONING_EFFORT: optional per-pass effort; the OpenCode Gox-opencode-sessionheader is sent only to opencode.ai./api/config.source_cache; a checkpoint without words is rejected when the mode is off; the remote-worker prepare path still requires words.The pipeline no longer imports
free_tools(which has a lazy cloud hook); the caption reader moved toyoutube_captions.py. That also keeps the existing audit test green.Defaults
All new environment variables default off; existing deployments are unchanged unless they opt in.
Testing
pytest tests/ -q: 2711 passed, 43 skipped.cd dashboard && npm run build && npm run lint.