Open dusekdan opened 5 months ago
Hello,
I just ran into the same issue. I replaced the line in question with:
model = WhisperModel(model_size, device="cpu", compute_type="float32")
And it works. Hope it helps you too !
Lol, just came back to say I iterated towards the same solution and got it working. Thanks for the tip.
For all those who will come to this issue looking for the same, here's how I iterated towards the solution:
WhisperModel
.WhisperModel
in my environment (installed by pip into virtualenv) in venv/Lib/site-packages/faster_whisper
- I know it's in the faster_whisper module, because the WhisperModel
is imported in the very beginning of the example from this module.transcribe.py
, so that's the file I open and look for class definitionNow there are two parameters of interest there - device
and compute_type
. When I previously just tried hardcoding cpu
for device, I would end up being told float16
is unsupported. So, my line of thinking was that I will look for what other types are supported and try their combinations.
Line 91 in transcribe contains a really long comment, out of which I will take out the most important parts:
"""
Initializes the Whisper model.
Args:
[...]
device: Device to use for computation ("cpu", "cuda", "auto").
compute_type: Type to use for computation.
See https://opennmt.net/CTranslate2/quantization.html.
[...]
"""
Quantization link provides a reference table of implicit type conversions on load, in which I was able to look up what is the default value for CPU for float16
, in my architecture (Intel, x64, it is float32
).
I changed the corresponding line to hardcode cpu
for device
variable and float32
for compute_type
and got result on the output.
Reference table for your convenience:
haha you went about it much more professionally than I did :) Happy we both found a solution.
Hello, I have the same error even with the fix :
Hello, I have the same error even with the fix :
Hi @mambari , did you find any solutions about this problem? same error occur to me.
Hi,
I followed the windows installation guide, and tried both on latest python 3.12 and 3.9.12 (per recommendation from the guide for python to be 3.9).
When I attempt to run the v2 example from
demo_part3.ipynb
, I am getting error originating from the following line:target_se, audio_name = se_extractor.get_se(reference_speaker, tone_color_converter, vad=False)
This is the error:
In the beginning of my script - I follow the demo and setup my
device
variable in the same way to fallback tocpu
. When I open these_extractor.py
file from the error above, I see that a device is hardcoded to be CUDA. And I end up with the error above.My device is using integrated graphics from Intel, so afaik it is not even CUDA-enabled. Does this mean I cannot run OpenVoice v2, without NVidia graphics?
This is the code from the library - se_extractor.py - with hardcoded cuda string, that raises the issue: