[#145] Surface a model-download indicator when an alignment model is fetched mid-transcription - #149
Merged
Conversation
Member
Author
QA Confidence Verdict — PR #149 (issue #145)Read-only verification against the derived ACs/truths. Scope: commits What Was VerifiedDerived ACs
Truths
All checks are programmatic (unit tests) + code inspection. None via Playwright — see Risk Areas. What Needs Human Eyes
Risk Areas
Suggested QA Focus
Overall confidence: HIGH — all 6 ACs and both truths verified against code + tests; residual gaps are live-UX/visual only. No truth fails; no spec drift (implements issue option 1 as documented in the plan). |
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.
Closes #145
Summary
Follow-up to #141. Pre-provisioning covers a configured set of HuggingFace alignment models (default
["th"]), but auto-detect can land on an HF-backed language that wasn't pre-provisioned, or a language outsidealign_languagescan be used. In those caseswhisperx.load_align_modeldownloads the model inside the align stage, leaving the job frozen atstage=aligning, progress=50("Aligning timestamps… 50%") — indistinguishable from a hang.This surfaces a distinct
downloading_align_modeljob stage while such a model is being fetched, so the progress bar reads "Downloading alignment model…" instead of a frozen "Aligning…". TheALIGNMENT_TIMEOUT_SECwatchdog remains the safety net.Approach
JobStage.DOWNLOADING_ALIGN_MODEL(issue option 1), preferred over reusing provisioning's separateDownloadStatelifecycle or gating up front (the detected language is unknown until transcription runs).align_models.align_model_cached(repo_id)useshuggingface_hub.try_to_load_from_cache(repo_id, "config.json")(lazy import, preserving the module's import-light contract; mirrorsprovisioning._snapshot_downloader). Any failure — includinghuggingface_hubbeing absent in the lightweight CI env — degrades to "assume present" (debug-logged), which only omits the indicator and never blocks alignment.model_name=None, shared~/.cache/torch) are unaffected._load_align_model_watchdoggedwraps both align sites (single-language and multilingual): flips todownloading_align_modelwhen the HF-backed model isn't cached, runs the watchdogged load, and always resets toaligningbefore returning — so a stalled or failed fetch never sticks on the download stage.transcript-viewer.js) and the macOS app (JobPresentation.swift).Plan:
docs/plans/145-align-model-download-indicator.md.Verification
tests/unit/test_align_models.py,tests/unit/test_transcriber.py,tests/unit/test_provisioning.py— all pass (79). New coverage: cache-probe outcomes (cached / not-cached / known-missing sentinel / hf_hub error / hf_hub absent) and the stage-flip behavior (HF-backed uncached surfacesdownloading_align_modelthenaligning; cached and torch-native do not).swift run MeetingTranscriberKitTests— 272 passed, incl. the newJobStagePresentationlabel assertion.ruff check+ruff format --checkclean.