GithubHelp home page GithubHelp logo

breitburg / lightning-whisper-mlx Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mustafaaljadery/lightning-whisper-mlx

0.0 1.0 0.0 2.94 MB

An extremely fast implementation of whisper optimized for Apple Silicon using MLX.

Home Page: https://mustafaaljadery.github.io/lightning-whisper-mlx/

Shell 0.19% Python 98.24% HTML 1.57%

lightning-whisper-mlx's Introduction

Lightning Whisper MLX

An incredibly fast implementation of Whisper optimized for Apple Silicon.

Whisper Decoding Speed

10x faster than Whisper CPP, 4x faster than current MLX Whisper implementation.

Features

  • Batched Decoding -> Higher Throughput
  • Distilled Models -> Faster Decoding (less layers)
  • Quantized Models -> Faster Memory Movement
  • Coming Soon: Speculative Decoding -> Faster Decoding with Assistant Model

Installation

Install lightning whisper mlx using pip:

pip install lightning-whisper-mlx

Usage

Models

["tiny", "small", "distil-small.en", "base", "medium", distil-medium.en", "large", "large-v2", "distil-large-v2", "large-v3", "distil-large-v3"]

Quantization

[None, "4bit", "8bit"]

Example

from lightning_whisper_mlx import LightningWhisperMLX

whisper = LightningWhisperMLX(model="distil-medium.en", batch_size=12, quant=None)

text = whisper.transcribe(audio_path="/audio.mp3")['text']

print(text)

Notes

  • The default batch_size is 12, higher is better for throughput but you might run into memory issues. The heuristic is it really depends on the size of the model. If you are running the smaller models, then higher batch size, larger models, lower batch size. Also keep in mind your unified memory!

Credits

  • Mustafa - Creator of Lightning Whisper MLX
  • Awni - Implementation of Whisper MLX (I built on top of this)
  • Vaibhav - Inspired me to build this (He created a version optimized for Cuda)

lightning-whisper-mlx's People

Contributors

mustafaaljadery avatar breitburg avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.