Repository navigation
feat(asr): prefetch the native Distil-Whisper presets with docling-tools - #4825
Conversation
Add whisper_distil_small_en, whisper_distil_medium_en, whisper_distil_large_v3 and whisper_distil_large_v3_5 to docling-tools models download. They fetch the OpenAI-format checkpoints that the native Distil presets load, into the output directory's Hugging Face cache layout, which is the layout the native transcriber already reads when artifacts_path is set. Plain --all still excludes them, and --all --asr includes them. Move _DISTIL_WHISPER_OPENAI_CHECKPOINTS from the transcriber to asr_model_specs, next to the presets it describes, so the downloader and the transcriber share one table. docling.utils already depends on vlm_model_specs for the same reason, so tach.toml gets the matching asr_model_specs edges. The missing-checkpoint error under artifacts_path now gives the docling-tools command instead of hf download. Signed-off-by: BBC, Esquire <bbc@chintellalaw.com>
|
✅ DCO Check Passed Thanks @BBC-Esq, all your commits are properly signed off. 🎉 |
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/
|
AI triage (advisory)Checked commit This pull request adds native Distil-Whisper model presets to Topic labels added: CI safety: needs maintainer care before you approve CI.
3 related pull request(s) in the same code
The |
There was a problem hiding this comment.
AI first review (advisory): no blocker found
This review covers the full diff at 65bd8dec2e. It read the code and did not run it.
The PR adds four Distil-Whisper presets to docling-tools models download, moves _DISTIL_WHISPER_OPENAI_CHECKPOINTS to asr_model_specs.py, updates the error message, and extends tach.toml. All four checkpoint keys round-trip correctly through _distil_whisper_prefetch_name to the enum values in _AvailableModels. The downloader uses hf_hub_download(cache_dir=output_dir) — the same layout the transcriber reads offline — which differs from the flat-file layout of regular Whisper models; this is intentional and consistent. No behavioral issues found; the human reviewer should confirm that PR #4771 (open, changes the same files) does not conflict with this one before merging.
A maintainer makes the merge decision. This review never approves the pull request.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Note
Description of this pull request
This PR adds the four native Distil-Whisper presets to
docling-tools models download, the same way #4760 added the native Whisper checkpoints:The new names are
whisper_distil_small_en,whisper_distil_medium_en,whisper_distil_large_v3andwhisper_distil_large_v3_5. Each one downloads the OpenAI-format checkpoint that its preset loads, into the output directory in the Hugging Face cache layout. That is the layout the native transcriber already reads whenartifacts_pathis set, because it callshf_hub_download(..., cache_dir=artifacts_path, local_files_only=True). Plain--allstill excludes ASR models, and--all --asrnow includes these four._DISTIL_WHISPER_OPENAI_CHECKPOINTSmoves fromasr_transcriber.pytoasr_model_specs.py, next to the presets it describes, so the downloader and the transcriber share one table.docling.utilsmay not import fromdocling.pipeline, and it already depends onvlm_model_specsfor the same reason, sotach.tomlgets the matchingasr_model_specsedges.When
artifacts_pathdoes not contain the checkpoint, the error message now gives thedocling-toolscommand instead ofhf download.I tested it end to end. I prefetched
distil-small.enwith the new command into an empty folder, then loaded it withHF_HUB_OFFLINE=1and transcribed a 94-second clip correctly. An empty folder still raises theFileNotFoundError, and the message now names the command that fixes it.Important
Related pull requests: step 2 of 4
These four pull requests add offline support (
--artifacts-pathanddocling-tools models download) for the ASR presets I contributed in #2938 and #3741, the same way that Peter Staar did in #4760 for native Whisper. A checked box means that step is merged.n_melsoverride in the WhisperS2T backend.docling-tools models download. ⬅️ this PR--artifacts-path, with prefetch throughdocling-tools models download.Related work for another backend: #4771 aims at the same goal for a new Transformers ASR backend (with MLX presets): its presets run Transformers-format checkpoints offline from
--artifacts-path(#4684). Both PRs change neighboring lines inasr_transcriber.py, so the second one to merge needs a small merge; if that is this PR, I will resolve it here.Checklist: