refactor(transcription): introduce AsrEngine trait (Track-B foundation)#9
Open
farce1 wants to merge 1 commit into
Open
refactor(transcription): introduce AsrEngine trait (Track-B foundation)#9farce1 wants to merge 1 commit into
farce1 wants to merge 1 commit into
Conversation
… recognizer
Foundation for pluggable ASR engines (Parakeet-TDT-v3 next). Extracts the sherpa
Whisper recognizer into transcription/engine.rs behind a small AsrEngine trait
(transcribe(samples) -> AsrOutput { text, language }); the worker now drives a
Box<dyn AsrEngine>. Behavior-preserving — same WhisperConfig and field mapping;
the VAD -> chunk -> transcribe loop was already engine-agnostic.
This was referenced Jun 14, 2026
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 — Track-B step 1 of N
The foundation for pluggable ASR engines (the path to Parakeet-TDT-v3). A behavior-preserving refactor that puts the existing sherpa Whisper recognizer behind a small trait:
transcription/engine.rs:AsrEngine,AsrOutput,WhisperEngine(wrapsWhisperRecognizer).worker.rsnow drives aBox<dyn AsrEngine>(loses ~14 lines; engine construction moved intoengine.rs). The VAD → chunk → transcribe loop was already engine-agnostic.WhisperConfig(lang auto, 2 threads, CPU) and identicaltext/languagemapping.A new engine (Parakeet) now plugs in by implementing
AsrEngine+ a loader — no furtherworker.rssurgery.Verification (TDD)
engine.rstest: trait is object-safe and returns engine output (via aFakeEngine, which also demonstrates the Parakeet extension point).clippy --all-targets --all-features -- -D warnings✅; fullcargo test→ only the pre-existingmodel_archive_consts_tests(REPLACE_WITH_placeholders) fail.Track-B roadmap (this is step 1)
ParakeetEnginevia sherpa-rsOfflineRecognizer(transducer) — Parakeet-TDT-v3retranscribe_meetingover stored OGGMerge note
worker.rsoverlaps with the Track-A PRs #4 (segment construction), #6 (resampler/sample-rate), #8 (panic-guard wraps the transcribe call). Integration: the panic-guard should wrapengine.transcribe, andbuild_segment_resultconsumesAsrOutput. Suggest merging Track-A first, then rebasing this.REPLACE_WITH_placeholders), not this PR. Code-only, no new deps (Parakeet will reuse sherpa-rs).