whisper-jax
whisper-jax copied to clipboard
Does the cached pipeline also work in CPU only?
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)