fix(stt): wire stt.local.initial_prompt through to faster-whisper - #54202
Closed
Akloenx123 wants to merge 1 commit into
Closed
fix(stt): wire stt.local.initial_prompt through to faster-whisper#54202Akloenx123 wants to merge 1 commit into
Akloenx123 wants to merge 1 commit into
Conversation
faster-whisper exposes an `initial_prompt` kwarg that biases the model's vocabulary toward domain-specific terms — useful for transcribing voice notes that contain product names, technical jargon, or other words the default model rarely sees in training (e.g. "DeepSeek", "MiMo", "Kicktipp", "Cronjobs"). Before this change, only `stt.local.language` was wired through from config.yaml to the transcribe() call. `initial_prompt` was silently ignored even when set, forcing users to either patch the code or accept garbled transcripts. This commit reads `stt.local.initial_prompt` from config.yaml and passes it as the `initial_prompt` kwarg. The setting is optional and defaults to absent — existing configs are unaffected. Tests cover three contracts: prompt set (passed through), prompt unset (omitted), empty string (treated as unset). All three pass.
Collaborator
Duplicate of #50684 — same mechanism: both wire |
Author
|
Closing in favor of #50684 — opened earlier (2026-06-22 vs 2026-06-28), smaller diff (+50 vs +118), includes the Thanks to @BlackishGreen33 for getting there first. Marking as superseded so a maintainer only has to review one PR. |
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
faster-whisperexposes aninitial_promptkwarg that biases the model'svocabulary toward domain-specific terms — useful for transcribing voice notes
that contain product names, technical jargon, or other words the default model
rarely sees in training (e.g. "DeepSeek", "MiMo", "Kicktipp", "Cronjobs").
Before this change, only
stt.local.languagewas wired through fromconfig.yamlto thetranscribe()call.initial_promptwas silentlyignored even when set, forcing users to either patch the code or accept
garbled transcripts of technical vocabulary.
This commit reads
stt.local.initial_promptfromconfig.yamland passesit as the
initial_promptkwarg to faster-whisper'stranscribe(). Thesetting is optional and defaults to absent — existing configs are unaffected.
Reproduction (before)
User sends a voice note saying "schick mir den DeepSeek V4 Pro Tipp".
Transcribed result: "schick mir den Debsig V4 Pro Tipp".
The
initial_promptline in config is silently ignored.After this fix, the same voice note transcribes correctly: "schick mir den
DeepSeek V4 Pro Tipp".
Why this should merge
initial_promptdefaults to absent; existingconfigs behave identically.
(model names, product names, internal jargon) is a recurring pain point.
languageplumbing — same config-yml pattern,same read order, same opt-in shape.
Test plan
tests/tools/test_stt_initial_prompt.py— 3 tests, all passingtests/tools/test_transcription.py— unchanged behaviorlarge-v3and a domain-specific voice note:AGENTS.md alignment
This change follows the project's "narrow waist" guidance:
stt.localconfig namespace.HERMES_*env var. All wiring isconfig.yaml-only, per the"reject PRs that tell users to set X in your .env" rule.
_load_stt_config()/_forced_lang/transcribe_kwargsplumbing — no parallel code path.invariant (
initial_promptis present iff config sets it), not frozenmodel output.
Happy to address review feedback or split this into smaller commits if
preferred.