Skip to content

feat: Add --whisper-prompt option for custom vocabulary hints - #13

Merged
francozanardi merged 1 commit into
francozanardi:mainfrom
MarianoFacundoArch:feat/whisper-prompt
Jan 31, 2026
Merged

francozanardi merged 1 commit into
francozanardi:mainfrom
MarianoFacundoArch:feat/whisper-prompt

Conversation

@MarianoFacundoArch

Copy link
Copy Markdown
Contributor

Summary

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.

Problem

When transcribing audio that contains brand names or technical terms, Whisper often misinterprets them. For example:

  • "PlateLens" gets transcribed as "Platelins"
  • Brand names and proper nouns are frequently incorrect

Solution

Whisper already supports an initial_prompt parameter that can hint the model about expected vocabulary. This PR exposes that parameter through a new --whisper-prompt CLI option.

Usage

pycaps render --input video.mp4 --template hype --whisper-prompt "PlateLens, BrandName"

Changes

File Change
whisper_audio_transcriber.py Accept initial_prompt parameter in __init__ and pass to Whisper's transcribe
caps_pipeline_builder.py Add initial_prompt parameter to with_whisper_config()
render_cli.py Add --whisper-prompt CLI option in Whisper panel

Benefits

  • ✅ Minimal code change (< 10 lines total)
  • ✅ Backward compatible (optional parameter, defaults to None)
  • ✅ Leverages existing Whisper capability
  • ✅ Significantly improves accuracy for brand names and technical terms
  • ✅ No external dependencies

References

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>
@francozanardi

francozanardi commented Jan 31, 2026

Copy link
Copy Markdown
Owner

Hey @MarianoFacundoArch

Thank you for this work!! I'll review it and let you know :)

@francozanardi
francozanardi merged commit 410d8fe into francozanardi:main Jan 31, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants