fix(docker): restore STT (faster-whisper) on Python 3.14
Previously removed all voice deps from the runtime image because of the numpy<2 / cp314 wheel chain. Actual upstream check (PyPI 2026-05-21) shows the chain has resolved for the STT half: - ctranslate2 v4.7.2 (2026-05-19) ships cp314 wheels - faster-whisper v1.2.1 is pure Python and works on any supported runtime - onnxruntime v1.26.0 has cp314 wheels (not used here but shared with the upcoming piper-tts install) The blocker was kokoro, not the whole stack. Kokoro has been stale upstream since April 2025 with a `requires_python='<3.13'` pin; that's being replaced separately with piper-tts. This commit restores ONLY STT — faster-whisper + soundfile. No torch (ctranslate2 does its own CPU inference), no kokoro, no spacy. Image add: ~150 MB. Voice code is lazily guarded; STT now works when VOICE_ENABLED=true. TTS still fails gracefully (kokoro import error logged, voice degrades) until the piper-tts swap lands. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+8
-7
@@ -17,13 +17,14 @@ COPY src/ src/
|
||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
pip install .
|
||||
|
||||
# Voice deps (faster-whisper, kokoro, torch, soundfile, spacy) are NOT
|
||||
# installed in the production image. They added ~2 GB and pulled numpy<2,
|
||||
# which has no cp314 wheel and broke the slim-image build.
|
||||
# Voice paths in code are lazily guarded; with VOICE_ENABLED=false (default),
|
||||
# the app starts cleanly. With voice enabled, missing imports log and
|
||||
# the feature gracefully degrades. To re-enable voice in a build, install
|
||||
# the `voice` extra: `pip install .[voice]` — and add an extras step here.
|
||||
# Speech-to-text (faster-whisper + soundfile). faster-whisper is pure
|
||||
# Python; the actual inference engine is ctranslate2 (C++) which has
|
||||
# cp314 wheels as of v4.7.2 (2026-05-19). No torch needed — ctranslate2
|
||||
# does its own CPU inference. Image add: ~150 MB.
|
||||
# TTS (piper-tts) is installed in a separate later step so STT can
|
||||
# stand alone if TTS becomes problematic.
|
||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
pip install faster-whisper soundfile
|
||||
|
||||
# Build the fable-mcp wheel so it can be served for download
|
||||
COPY fable-mcp/ fable-mcp/
|
||||
|
||||
Reference in New Issue
Block a user