18 Commits

Author SHA1 Message Date
teknium1 8ecc3dd71e fix(stt): treat a partial whisper cache as a cache miss
An interrupted first download leaves refs/main plus a snapshot folder
without model.bin. snapshot_download(local_files_only=True) returns that
folder rather than raising LocalEntryNotFoundError, so ctranslate2 fails
with RuntimeError "Unable to open file 'model.bin'" and the online path
never ran, leaving STT permanently broken with a misleading error. Fall
through to the download when the local attempt fails that way. The
loading tests are also gated on faster_whisper being installed, so the
module collects when the voice extra is absent.

Review finding: partial-cache RuntimeError bypassed the online fallback.
2026-09-15 05:36:37 -07:00
teknium1 0bb460b488 fix(stt): tolerate a missing huggingface_hub when checking the whisper cache
The cache-first loader imported LocalEntryNotFoundError unconditionally; in
environments without the optional huggingface_hub dependency every local
transcription raised ModuleNotFoundError. Resolve the cache-miss exception
lazily and fall back to its OSError base class when the package is absent.
2026-09-15 05:36:37 -07:00
teknium1 489ad83907 fix(stt): only rewrap Hub/network failures on the whisper download path
The salvaged fallback caught bare Exception around the online load, which
would relabel a CUDA runtime error or an invalid model size as a download
problem and defeat the CUDA → CPU fallback above it. huggingface_hub raises
every network/Hub failure as an OSError subclass (LocalEntryNotFoundError,
HfHubHTTPError), so catch that class only. The negative test now feeds the
real LocalEntryNotFoundError('Got: ConnectTimeout ...') shape the reporter
saw instead of a synthetic RuntimeError.
2026-09-15 05:36:37 -07:00
fangliquan ebb6dc6e70 fix(stt): prefer cached local whisper models 2026-09-15 05:36:37 -07:00
Teknium 62732c7d8b simplify(compat): tools/transcription_tools — drop 47 re-exports/aliases, repoint 4 callers + 9 test files 2026-09-03 13:17:25 -07:00
Teknium e83816a4d1 review-fix(comments): restore lost #NNNN rationale comments across non-test source (mechanical sweep, condensed, code unchanged)
For each issue anchor present in BASE 63279301bc non-test .py and absent on HEAD, the BASE comment/docstring block was re-attached at the HEAD location of the code it explained (matched by the distinctive code line / enclosing def). Sentences already covered by an existing HEAD comment were deduped; the issue number always survives. Insert-only: no code lines changed.
2026-09-03 09:44:26 -07:00
Teknium b57f17bd4b fix(late-slices): restore subprocess footgun guards re-collapsed by r3-30/33/34/36 tails; telegram format_message stays self-free (staticmethod via class ref); _captured_exec explicit shell/env kwargs 2026-09-03 05:33:46 -07:00
Teknium ff44eca74f refactor(tools): compact STT module docstrings and section banners, keep every invariant 2026-09-03 01:13:03 -07:00
Teknium d85b86e97a refactor(tools): AST-neutral closer/bracket hug pass over STT/TTS modules 2026-09-03 00:53:14 -07:00
Teknium 404a324ea5 refactor(tools): fold local STT loader/gates and TTS normalizer passes into table-driven substitutions 2026-09-03 00:52:11 -07:00
Teknium d34703fa86 refactor(tools): AST-neutral layout compaction of STT/TTS modules 2026-09-02 22:45:22 -07:00
Teknium 4d37eddc2f refactor(tools): unify STT/TTS command-provider config helpers, REST STT flow, dispatch tables 2026-09-02 22:41:57 -07:00
Teknium d7cdfbc36b refactor(stt): openai-availability reason helper, one-line section banners, docstring compaction 2026-09-02 16:12:29 -07:00
Teknium 60aa491f3d refactor(stt): local backend detection helper, CPU-eviction helper, module docstrings and import packing 2026-09-02 16:10:20 -07:00
Teknium 063517e745 refactor(stt): shared lazy-install helper, compact trim/validation/local-kwargs bodies, repack re-export block 2026-09-02 16:04:57 -07:00
Teknium 5844839639 refactor(stt): fold no-provider error tail, drop _normalize_local_command_model alias, compact dispatcher call sites 2026-09-02 15:59:38 -07:00
Teknium bf427a20a1 refactor(stt): collapse duplicate validators/process-error detail/CAF converter, managed-gateway helper, read-block guard 2026-09-02 15:52:30 -07:00
Teknium 282e63f81c refactor(stt): split transcription_tools into common/audio/local/cloud/command sibling modules (re-imported into origin) 2026-09-02 15:36:59 -07:00