openai-whisper-cpu VS whisperX

Compare openai-whisper-cpu vs whisperX and see what are their differences.

openai-whisper-cpu

Improving transcription performance of OpenAI Whisper for CPU based deployment (by MiscellaneousStuff)

whisperX

WhisperX: Automatic Speech Recognition with Word-level Timestamps (& Diarization) (by m-bain)
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
openai-whisper-cpu whisperX
5 24
221 8,965
- -
10.0 8.4
over 1 year ago 6 days ago
Jupyter Notebook Python
MIT License BSD 4-Clause "Original" or "Old" License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

openai-whisper-cpu

Posts with mentions or reviews of openai-whisper-cpu. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-05-14.
  • How to run Llama 13B with a 6GB graphics card
    12 projects | news.ycombinator.com | 14 May 2023
    I feel the same.

    For example some stats from Whisper [0] (audio transcoding) show the following for the medium model (see other models in the link):

    ---

    GPU medium fp32 Linear 1.7s

    CPU medium fp32 nn.Linear 60.7

    CPU medium qint8 (quant) nn.Linear 23.1

    ---

    So the same model runs 35.7 times faster on GPU, and compared to an CPU-optimized model still 13.6.

    I was expecting around an order or magnitude of improvement. Then again, I do not know if in the case of this article the entire model was in the GPU, or just a fraction of it (22 layers), which might explain the result.

    [0] https://github.com/MiscellaneousStuff/openai-whisper-cpu

  • Whispers AI Modular Future
    14 projects | news.ycombinator.com | 20 Feb 2023
    According to https://github.com/MiscellaneousStuff/openai-whisper-cpu the medium model needs 1.7 seconds to transcribe 30 seconds of audio when run on a GPU.
  • [P] Transcribe any podcast episode in just 1 minute with optimized OpenAI/whisper
    4 projects | /r/MachineLearning | 6 Nov 2022
    There is a very simple method built-in to PyTorch which can give you over 3x speed improvement for the large model, which you could also combine with the method proposed in this post. https://github.com/MiscellaneousStuff/openai-whisper-cpu
  • [D] How to get the fastest PyTorch inference and what is the "best" model serving framework?
    8 projects | /r/MachineLearning | 28 Oct 2022
    For CPU inference, model quantization is a very easy to apply method with great average speedups which is already built-in to PyTorch. For example, I applied dynamic quantization to the OpenAI Whisper model (speech recognition) across a range of model sizes (ranging from tiny which had 39M params to large which had 1.5B params). Refer to the below table for performance increases:
  • [P] OpenAI Whisper - 3x CPU Inference Speedup
    1 project | /r/MachineLearning | 27 Oct 2022
    GitHub

whisperX

Posts with mentions or reviews of whisperX. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-03-31.
  • Easy video transcription and subtitling with Whisper, FFmpeg, and Python
    1 project | news.ycombinator.com | 6 Apr 2024
    It uses this, which does support diarization: https://github.com/m-bain/whisperX
  • SOTA ASR Tooling: Long-Form Transcription
    1 project | news.ycombinator.com | 31 Mar 2024
    Author compared various whisper implementation

    "We found that WhisperX is the best framework for transcribing long audio files efficiently and accurately. It’s much better than using the standard openai-whisper library."

    https://github.com/m-bain/whisperX

  • Deploying whisperX on AWS SageMaker as Asynchronous Endpoint
    2 projects | dev.to | 31 Mar 2024
    import os # Directory and file paths dir_path = './models-v1' inference_file_path = os.path.join(dir_path, 'code/inference.py') requirements_file_path = os.path.join(dir_path, 'code/requirements.txt') # Create the directory structure os.makedirs(os.path.dirname(inference_file_path), exist_ok=True) # Inference.py content inference_content = '''# inference.py # inference.py import io import json import logging import os import tempfile import time import boto3 import torch import whisperx DEVICE = 'cuda' if torch.cuda.is_available() else 'cpu' s3 = boto3.client('s3') def model_fn(model_dir, context=None): """ Load and return the WhisperX model necessary for audio transcription. """ print("Entering model_fn") logging.info("Loading WhisperX model") model = whisperx.load_model(whisper_arch=f"{model_dir}/guillaumekln/faster-whisper-large-v2", device=DEVICE, language="en", compute_type="float16", vad_options={'model_fp': f"{model_dir}/whisperx/vad/pytorch_model.bin"}) print("Loaded WhisperX model") print("Exiting model_fn with model loaded") return { 'model': model } def input_fn(request_body, request_content_type): """ Process and load audio from S3, given the request body containing S3 bucket and key. """ print("Entering input_fn") if request_content_type != 'application/json': raise ValueError("Invalid content type. Must be application/json") request = json.loads(request_body) s3_bucket = request['s3bucket'] s3_key = request['s3key'] # Download the file from S3 temp_file = tempfile.NamedTemporaryFile(delete=False) s3.download_file(Bucket=s3_bucket, Key=s3_key, Filename=temp_file.name) print(f"Downloaded audio from S3: {s3_bucket}/{s3_key}") print("Exiting input_fn") return temp_file.name def predict_fn(input_data, model, context=None): """ Perform transcription on the provided audio file and delete the file afterwards. """ print("Entering predict_fn") start_time = time.time() whisperx_model = model['model'] logging.info("Loading audio") audio = whisperx.load_audio(input_data) logging.info("Transcribing audio") transcription_result = whisperx_model.transcribe(audio, batch_size=16) try: os.remove(input_data) # input_data contains the path to the temp file print(f"Temporary file {input_data} deleted.") except OSError as e: print(f"Error: {input_data} : {e.strerror}") end_time = time.time() elapsed_time = end_time - start_time logging.info(f"Transcription took {int(elapsed_time)} seconds") print(f"Exiting predict_fn, processing took {int(elapsed_time)} seconds") return transcription_result def output_fn(prediction, accept, context=None): """ Prepare the prediction result for the response. """ print("Entering output_fn") if accept != "application/json": raise ValueError("Accept header must be application/json") response_body = json.dumps(prediction) print("Exiting output_fn with response prepared") return response_body, accept ''' # Write the inference.py file with open(inference_file_path, 'w') as file: file.write(inference_content) # Requirements.txt content requirements_content = '''speechbrain==0.5.16 faster-whisper==0.7.1 git+https://github.com/m-bain/whisperx.git@1b092de19a1878a8f138f665b1467ca21b076e7e ffmpeg-python ''' # Write the requirements.txt file with open(requirements_file_path, 'w') as file: file.write(requirements_content)
  • OpenVoice: Versatile Instant Voice Cloning
    7 projects | news.ycombinator.com | 29 Mar 2024
    Whisper doesn't, but WhisperX <https://github.com/m-bain/whisperX/> does. I am using it right now and it's perfectly serviceable.

    For reference, I'm transcribing research-related podcasts, meaning speech doesn't overlap a lot, which would be a problem for WhisperX from what I understand. There's also a lot of accents, which are straining on Whisper (though it's also doing well), but surely help WhisperX. It did have issues with figuring number of speakers on it's own, but that wasn't a problem for my use case.

  • FLaNK 15 Jan 2024
    21 projects | dev.to | 15 Jan 2024
  • Subtitle is now open-source
    3 projects | news.ycombinator.com | 24 Nov 2023
    I've had good results with whisperx when I needed to generate captions. https://github.com/m-bain/whisperX

    There is currently a problem with diarization, but otherwise, it is SOTA.

  • Insanely Fast Whisper: Transcribe 300 minutes of audio in less than 98 seconds
    8 projects | news.ycombinator.com | 14 Nov 2023
    https://github.com/m-bain/whisperX/issues/569

    WhisperX with the new model. It's not fast.

  • Distil-Whisper: distilled version of Whisper that is 6 times faster, 49% smaller
    14 projects | news.ycombinator.com | 31 Oct 2023
    How much faster in real wall-clock time is this in batched data than https://github.com/m-bain/whisperX ?
  • whisper self hosted what's the most cost-efficient way
    1 project | /r/selfhosted | 17 Oct 2023
    Checkout whisperx
  • Whisper Turbo: transcribe 20x faster than realtime using Rust and WebGPU
    3 projects | news.ycombinator.com | 12 Sep 2023
    Neat to see a new implementation, although I'll note that for those looking for a drop-in replacement for the whisper library, I believe that both faster-whisper https://github.com/guillaumekln/faster-whisper and https://github.com/m-bain/whisperX are easier (PyTorch-based, doesn't require a web browser), and a lot faster (WhisperX is up to 70X realtime).

What are some alternatives?

When comparing openai-whisper-cpu and whisperX you can also consider the following projects:

llama-cpp-python - Python bindings for llama.cpp

whisper.cpp - Port of OpenAI's Whisper model in C/C++

intel-extension-for-pytorch - A Python package for extending the official PyTorch that can easily obtain performance on Intel platform

whisper - Robust Speech Recognition via Large-Scale Weak Supervision

FlexGen - Running large language models on a single GPU for throughput-oriented scenarios.

faster-whisper - Faster Whisper transcription with CTranslate2

buzz - Buzz transcribes and translates audio offline on your personal computer. Powered by OpenAI's Whisper.

insanely-fast-whisper - Incredibly fast Whisper-large-v3

kernl - Kernl lets you run PyTorch transformer models several times faster on GPU with a single line of code, and is designed to be easily hackable.

ControlNet - Let us control diffusion models!

BentoML - The most flexible way to serve AI/ML models in production - Build Model Inference Service, LLM APIs, Inference Graph/Pipelines, Compound AI systems, Multi-Modal, RAG as a Service, and more!

subgen - Autogenerate subtitles using OpenAI Whisper Model via Jellyfin, Plex, Emby, Tautulli, or Bazarr