Skip to content

Add initial_prompt and hotwords support for Whisper transcription#25

Merged
paberr merged 2 commits into
paberr:mainfrom
gunnzolder:whisper-prompt
Jun 2, 2026
Merged

Add initial_prompt and hotwords support for Whisper transcription#25
paberr merged 2 commits into
paberr:mainfrom
gunnzolder:whisper-prompt

Conversation

@gunnzolder

Copy link
Copy Markdown
Contributor

Problem

WhisperX exposes initial_prompt (context priming) and hotwords (recognition
boosts for specific terms) via asr_options, but ownscribe had no way to pass
them through. Without them, recordings with product names, jargon, or non-English
proper nouns get silently mis-transcribed with no fix short of post-processing.

Solution

Expose both parameters via:

  • CLI flags: --initial-prompt and --hotwords
  • Config file: initial_prompt and hotwords under [transcription]

Both default to empty (no change to existing behaviour). When set, they are forwarded
to whisperx.load_model() via asr_options.

One-off via CLI

ownscribe --initial-prompt "Acme Corp Q2 planning. Speakers: Alice, Bob."
--hotwords "ownscribe,WhisperX,pyannote"

Persistent via config

[transcription]
initial_prompt = "Weekly eng sync. Speakers: Alice, Bob, Carol."
hotwords = "ownscribe,WhisperX,pyannote"

Test plan

  • uv run pytest — all 230 tests pass
  • uv run ruff check src/ tests/ — clean
  • --initial-prompt and --hotwords appear in ownscribe --help
  • Setting both in config and running a transcription forwards them to WhisperX
    without error
  • Omitting both leaves existing behaviour unchanged (asr_options stays empty)

- Add initial_prompt and hotwords fields to TranscriptionConfig
- Pass them via asr_options to whisperx.load_model() at model-load time
- Expose --initial-prompt and --hotwords CLI flags
- Document both options as commented examples in default config

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@paberr paberr merged commit cd56e0b into paberr:main Jun 2, 2026
2 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.

3 participants