whisper-jax icon indicating copy to clipboard operation
whisper-jax copied to clipboard

Does the cached pipeline also work in CPU only?

Open Si-ris-B opened this issue 1 year ago • 0 comments

I have timed both pipelines with the following code. But the result is almost same. Cached function is only 10 seconds faster. Also it is very much slower than faster-whisper, both in cpu-only. Is this a normal or is it some other issue?

from whisper_jax import FlaxWhisperPipline
import jax.numpy as jnp
import time

pipeline = FlaxWhisperPipline("openai/whisper-large-v2", batch_size=8)

# transcribe and return timestamps - compilation step will be slow
start = time.time()
outputs = pipeline("audio.mp3",  task="transcribe", return_timestamps=True)
runtime = time.time() - start
print("Compilation: ", runtime)

# transcribe again - use cached function, will be fast
start = time.time()
outputs = pipeline("audio.mp3",  task="transcribe", return_timestamps=True)
runtime = time.time() - start
print("Cached: ", runtime)

Si-ris-B avatar May 31 '23 07:05 Si-ris-B