Skip to content

Conversation

alubbe
Copy link
Contributor

@alubbe alubbe commented Aug 28, 2025

This PR is bringing over the --carry-initial-prompt flag from the python library (openai/whisper#2343)

By default, an --prompt (initial prompt) is only used for the first decoding window; subsequent windows rely on the text generated so far for continuity. When you pass --carry-initial-prompt, the initial prompt tokens are explicitly prepended to every internal decode window. This mirrors the Python reference implementation's carry_initial_prompt behavior and can help enforce custom vocabulary or style throughout long transcriptions. Trade‑off: it may slightly reduce the model's ability to adapt dynamically to newly generated context (can increase risk of repetitions if the prompt is long). If the combined size of the carried initial prompt and the rolling context exceeds half the model text context, the leftmost (oldest) part of the initial prompt is truncated to fit.

Copy link
Collaborator

@KitaitiMakoto KitaitiMakoto left a comment

Choose a reason for hiding this comment

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

Patches for Ruby are nice, though I'm not sure the essential changes and API are accepted. Let me point just a thing.

@alubbe
Copy link
Contributor Author

alubbe commented Sep 8, 2025

Changes applied - let me know what you think of this PR

@alubbe alubbe requested a review from KitaitiMakoto September 8, 2025 11:02
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