feat: Add --whisper-prompt option for custom vocabulary hints - #13
Merged
francozanardi merged 1 commit intoJan 31, 2026
Merged
Conversation
Adds the ability to pass vocabulary hints to Whisper's `initial_prompt` parameter for improved transcription accuracy on brand names, technical terms, and other uncommon words. Usage: pycaps render --input video.mp4 --template hype --whisper-prompt "BrandName" Changes: - whisper_audio_transcriber.py: Accept initial_prompt parameter - caps_pipeline_builder.py: Pass initial_prompt to WhisperAudioTranscriber - render_cli.py: Add --whisper-prompt CLI option Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Owner
|
Thank you for this work!! I'll review it and let you know :) |
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
Adds the ability to pass vocabulary hints to Whisper's
initial_promptparameter for improved transcription accuracy on brand names, technical terms, and other uncommon words.Problem
When transcribing audio that contains brand names or technical terms, Whisper often misinterprets them. For example:
Solution
Whisper already supports an
initial_promptparameter that can hint the model about expected vocabulary. This PR exposes that parameter through a new--whisper-promptCLI option.Usage
pycaps render --input video.mp4 --template hype --whisper-prompt "PlateLens, BrandName"Changes
whisper_audio_transcriber.pyinitial_promptparameter in__init__and pass to Whisper's transcribecaps_pipeline_builder.pyinitial_promptparameter towith_whisper_config()render_cli.py--whisper-promptCLI option in Whisper panelBenefits
References