Make whisper an optional extra with faster-whisper by default#1877
Make whisper an optional extra with faster-whisper by default#1877Dreamsorcerer wants to merge 12 commits intodevfrom
Conversation
|
TTS seems to work pretty well with faster-whisper anyway. |
Greptile SummaryThis PR makes
Confidence Score: 4/5Safe to merge after fixing the misleading UserWarning that fires for all default users. One P1 finding: the UserWarning implies a degraded fallback state for every default install, which will confuse users. The missing version constraint on faster-whisper (P2) could also cause a runtime TypeError with older versions. Both are straightforward one-line fixes. dimos/stream/audio/stt/node_whisper.py (misleading warning), pyproject.toml (missing version constraint) Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[import WhisperNode] --> B{try: import whisper}
B -- success --> C[_USE_FASTER_WHISPER = False\nopenai-whisper backend]
B -- ImportError --> D{try: from faster_whisper\nimport WhisperModel}
D -- success --> E[UserWarning fired\n_USE_FASTER_WHISPER = True\nfaster-whisper backend]
D -- ImportError --> F[Raise ImportError\nNo backend found]
C --> G[WhisperNode.__init__]
E --> G
G --> H{_USE_FASTER_WHISPER?}
H -- True --> I[pop fp16 → compute_type\nWhisperModel device=auto]
H -- False --> J[whisper.load_model]
I --> K[transcribe → segments iterator\njoin seg.text]
J --> L[transcribe → dict\nresult text]
Reviews (1): Last reviewed commit: "Add warning" | Re-trigger Greptile |
Problem
Whisper requires downloading a 150MB model and depends on torch (with GBs of CUDA downloads).
Solution
Provide faster-whisper by default (2MB) and use as a fallback when whisper is not available.
This avoids the 150MB download, and means we are one step closer to not depending on torch for a base install.
Breaking Changes
Users need to request
dimos[whisper]now for full whisper feature.Test