feat(asr): expose beam_size and condition_on_previous_text (native) - #3704
Closed
BBC-Esq wants to merge 1 commit into
Closed
feat(asr): expose beam_size and condition_on_previous_text (native)#3704BBC-Esq wants to merge 1 commit into
BBC-Esq wants to merge 1 commit into
Conversation
The native Whisper backend ran with whisper's defaults (greedy decoding, condition_on_previous_text=True) and exposed no way to change them, which can cause runaway-repetition hangs on long-form audio. Expose both as fields on InlineAsrNativeWhisperOptions and forward them in transcribe(); defaults match whisper's, so existing behaviour is unchanged. Refs docling-project#3703 Signed-off-by: BBC, Esquire <bbc@chintellalaw.com>
Contributor
|
✅ DCO Check Passed Thanks @BBC-Esq, all your commits are properly signed off. 🎉 |
Contributor
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us 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.
Issue resolved by this Pull Request:
Resolves #3703
What
The native (openai-whisper) ASR backend forwarded only
verboseandword_timestampstotranscribe()and exposed no decoding parameters onInlineAsrNativeWhisperOptions. With whisper's default greedy decoding (beam_size=None), long-form audio can spiral into runaway repetition and effectively hang, with no workaround available through the docling API. Root-cause isolation and benchmarks are in #3703.This exposes two of whisper's decoding parameters on
InlineAsrNativeWhisperOptionsand forwards them in the nativetranscribe()call:beam_size: Optional[int] = Nonecondition_on_previous_text: bool = TrueBoth default to whisper's own defaults, so existing behaviour is unchanged. Setting
beam_size=5(beam search) orcondition_on_previous_text=Falsereliably avoids the repetition hang on long-form audio.Modified files
docling/datamodel/pipeline_options_asr_model.py— addedbeam_sizeandcondition_on_previous_texttoInlineAsrNativeWhisperOptions.docling/pipeline/asr_pipeline.py— read both in_NativeWhisperModeland forward them intranscribe().tests/test_asr_pipeline.py— addedtest_native_whisper_forwards_decode_params.Notes
beam_sizeto a non-greedy value (e.g.5) if you'd prefer the hang fixed out-of-the-box.temperatureandlanguagewere intentionally left out: forwardingtemperature=0.0would change transcription output, and the option'slanguage="en"default would regress non-English audio. Glad to add them in a follow-up if wanted.Checklist:
Field(description=...).)