pywhispercpp  by absadiki

Python bindings for whisper.cpp, enabling local speech transcription

created 2 years ago
278 stars

Top 94.3% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides Python bindings for whisper.cpp, enabling efficient, on-device speech-to-text transcription. It targets developers and researchers needing to integrate robust ASR capabilities into Python applications, offering a simpler API over the core C++ library and supporting various hardware acceleration backends.

How It Works

The library wraps the whisper.cpp C++ library, exposing its functionality through a Pythonic interface. It leverages GGML for efficient tensor operations and model execution, allowing for CPU and GPU (CUDA, CoreML, Vulkan) acceleration. Users can load whisper models, transcribe audio files, and access various parameters for fine-tuning the transcription process.

Quick Start & Requirements

  • Install CPU version: pip install pywhispercpp
  • Install from source for best performance: pip install git+https://github.com/absadiki/pywhispercpp
  • GPU support requires CUDA, CoreML, or Vulkan installation.
  • ffmpeg is required for non-WAV audio files.
  • Official documentation: https://github.com/absadiki/pywhispercpp

Highlighted Details

  • Supports multiple hardware acceleration backends: CUDA, CoreML, Vulkan, OpenBLAS, and OpenVINO.
  • Provides a Command Line Interface (CLI) tool (pwcpp) for direct audio file transcription.
  • Includes an Assistant example demonstrating real-time transcription with Voice Activity Detection (VAD).
  • Allows direct access to underlying C-APIs for advanced usage.

Maintenance & Community

Licensing & Compatibility

  • MIT License, consistent with whisper.cpp.
  • Permissive license suitable for commercial and closed-source applications.

Limitations & Caveats

The print_realtime option is noted as potentially problematic, recommending the use of callbacks instead. The OpenVINO support notes compatibility with Ubuntu22 toolkit on Ubuntu24, suggesting potential version-specific issues.

Health Check
Last commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
1
Star History
36 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.