-
Notifications
You must be signed in to change notification settings - Fork 878
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
With CPU, it's quite slow. A 2-minute MP3 takes 6 minutes to finish. #279
Comments
How are you running the original implementation from OpenAI? Are you comparing for the same beam size and number of CPU threads? Also what is your CPU? |
The original implementation from OpenAI
The default beam size could be 5. CPU RAM : 22GB |
Actually the default beam size is 1 when you use OpenAI Whisper from Python (cf. #6). So for a better comparison you should set the same beam size, number of threads, and initial prompt. That being said faster-whisper should take much less than 6 minutes for this audio file. Did you also measure the time to download the model? Here's the result on my system with an Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz: import os
import time
os.environ["OMP_NUM_THREADS"] = "6"
import whisper
import faster_whisper
def run_openai_whisper():
model = whisper.load_model("small.en", device="cpu")
result = model.transcribe(
"small.mp3",
beam_size=5,
word_timestamps=True,
initial_prompt="Welcome to the software engineering courses channel.",
)
def run_faster_whisper():
model = faster_whisper.WhisperModel("small.en", device="cpu", compute_type="int8")
segments, _ = model.transcribe(
"small.mp3",
beam_size=5,
word_timestamps=True,
initial_prompt="Welcome to the software engineering courses channel.",
)
segments = list(segments)
run_openai_whisper()
start = time.time()
run_openai_whisper()
end = time.time()
print("openai-whisper: %f seconds" % (end - start))
run_faster_whisper()
start = time.time()
run_faster_whisper()
end = time.time()
print("faster-whisper: %f seconds" % (end - start))
|
what is the maximum limit of os.environ["OMP_NUM_THREADS"]? Is it 6 or more than that. |
There is no maximum, but using too many threads can negatively impact the performance. In general you should not use more threads than the number of physical cores. You should run some benchmark on your system to find the best value. |
Indeed, it's quite slow. A 2-minute MP3 takes 6 minutes to finish. Meanwhile, OpenAI's Whisper finishes within 2 minutes. Did I do something wrong? Here's the code I used:
Originally posted by @zxl777 in #271 (comment)
The text was updated successfully, but these errors were encountered: