Compilation error using faster-whisper on Python 3.11.9 ( undefined function issues)

Hi everyone, I’m new to Hugging Face and Python in general. I’m trying to use the faster-whisper library with Python 3.11.9 on Windows, but I keep running into a few issues. Here’s a summary of what I’m seeing: — ### Python Version:3.11.9

Python 3.11.9 (tags/v3.11.9:de54cf5, Apr 2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.

from faster_whisper import WhisperModel
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘faster_whisper’

model_path = download_model(model_size_or_path, local_files_only=False)
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘download_model’ is not defined

Choose model: “small”, “medium”, “large-v2”, etc.

model_size = “small” # or “large-v2”

Create model instance with CPU and batch_size=8

model = WhisperModel(model_size_or_path=“Systran/faster-whisper-small”,device=“cpu”,compute_type=“int8”,batch_size=8,
… local_files_only=False )
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘WhisperModel’ is not defined

This allows it to download the model if not cached

Path to audio

Is download_model() a separate function I need to import manually, and if so, from where?

1 Like

File “”, line 1, in

Normally, Python programs are composed of multiple lines that together form a single program (script), but it seems that they are being executed one line at a time and failing…
It is possible that there is a mistake in the operation of Jupyter Notebook, Colab, or something similar.

BTW, faster-whisper can be installed with pip install faster-whisper.