Use int8 compute_type for WhisperX on non-CUDA devices#58
Open
pyjeebz wants to merge 1 commit into
Open
Conversation
faster-whisper / ctranslate2 reject float16 on CPU with ValueError, so the WhisperX subprocess in ExtractWordsFromAudio fails for any user without an NVIDIA GPU. Mirror the pattern already used for `device` and pick int8 (faster-whisper's recommended CPU compute type) when CUDA is unavailable.
There was a problem hiding this comment.
Pull request overview
Fixes CPU-only execution of WhisperX transcription by selecting a supported compute_type when CUDA isn’t available, unblocking get_events_dataframe() / end-to-end model.predict() on non-NVIDIA environments.
Changes:
- Switch WhisperX
compute_typefrom always-float16tofloat16on CUDA andint8on CPU.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
ExtractWordsFromAudio._get_transcript_from_audiohardcodescompute_type = "float16"for the WhisperX subprocess regardless of device (tribev2/eventstransforms.py:107-108):faster-whisper (via ctranslate2) refuses float16 on CPU and raises:
Anyone without an NVIDIA GPU hits this when calling
get_events_dataframe()on text or audio inputs (text goes through TTS → WhisperX too), which blocksmodel.predict()end-to-end on CPU-only environments.The fix mirrors the
deviceselection one line up — keepfloat16on CUDA, fall back toint8on CPU.int8is what faster-whisper recommends for CPU per their README.Repro on a CPU-only box:
CUDA users are unaffected. Verified locally on WSL2 /
torch==2.6.0+cpu: WhisperX large-v3 returned the expected word timings, and a full text-modemodel.predict()completed end-to-end (output shape(n_timesteps, 20484)on fsaverage5, matching the model card). I haven't run the[test]extra's pytest suite — happy to if useful. CLA signed.