Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Fix unsupported default compute type in the case of CPU use #384

Open
3manifold opened this issue Jan 13, 2025 · 0 comments · May be fixed by #383
Open

[Feature]: Fix unsupported default compute type in the case of CPU use #384

3manifold opened this issue Jan 13, 2025 · 0 comments · May be fixed by #383
Labels
enhancement New feature or request

Comments

@3manifold
Copy link

3manifold commented Jan 13, 2025

Description

The app defaults to an unsupported compute_type (float16) when running on a CPU-only system. To fix that, the user has to explicitly append --compute_type int8 to the call command each time the application runs. This feature provides a fix including the automatic assignment of the compatible compute type (int8) on a CPU-only system.

Reproduce

Call python3 main.py on CPU-only system:

$ python3 main.py
<...>
torchaudio.set_audio_backend("soundfile")
torchvision is not available - cannot save figures
Initialize logger for main
xxx 14:44:17,420 - main - DEBUG - Loading models...
xxx 14:44:17,420 - main - INFO - Using CPU
<...>
xxx 14:44:17,422 - main - DEBUG - * Loading Speaker Diarization Model
xxx 14:45:09,498 - main - DEBUG - * Loading ASR Model
--------------------------------------------------------------------------------------------------------------------------------------------------------
main.py 526 <module>
asr_model = whisper_asr.load_asr_model(
    whisper_asr.py 234 load_asr_model
model = model or WhisperModel(
    transcribe.py 133 __init__
self.model = ctranslate2.models.Whisper(
    ValueError:
Requested float16 compute type, but the target device or backend do not support efficient float16 computation.

The error was expected to occur since according to whisperX documentation, whisperX expects compute type to be int8.

To run on CPU instead of GPU (and for running on Mac OS X): whisperx examples/sample01.wav --compute_type int8

Implementation can be found in pull request #383 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant