Skip to main content

A toolkit for whisper.cpp with audio processing and model management

Project description

WhisperCPP Kit 🎙️

PyPI version License: MIT

🚀 A Python wrapper around whisper.cpp with model management and helper features.

✨ Features

  • 🔄 Automatic building and setup of whisper.cpp
  • 🎯 Simple, intuitive Python API
  • 🔧 Built-in model management
  • 🚦 Clear error messages and dependency checks
  • 🎵 Automatic audio format conversion
  • 🧵 Multi-threading support
  • 🐳 Docker support
  • 🎯 Support for custom and fine-tuned models
  • ⚡ Cached builds for faster subsequent inference

📋 System Requirements

Before installing whispercpp_kit, ensure you have these system-level dependencies:

Required dependencies 🛠️

  • git
  • cmake
  • ffmpeg
  • make
  • g++/gcc (C++ compiler)
  • Build essentials

Installation commands 📦

Ubuntu/Debian
sudo apt update
sudo apt install git cmake ffmpeg build-essential
MacOS
brew install git cmake ffmpeg gcc make
CentOS/RHEL
sudo yum update
sudo yum groupinstall "Development Tools"
sudo yum install git cmake ffmpeg gcc-c++ make

⚠️ Windows is currently not supported. Please use WSL (Windows Subsystem for Linux) with Ubuntu.

🚀 Quick start

Installation

pip install whispercpp_kit

Basic usage

from whispercpp_kit import WhisperCPP

# Initialize with default model
whisper = WhisperCPP(model_name="tiny.en")

# Transcribe audio
text = whisper.transcribe("audio.mp3")
print(text)

Advanced configuration

# Using standard models
whisper = WhisperCPP(
    model_name="tiny.en",
    num_threads=8,        # Control threads number
    verbose=True,         # Enable verbose output
    cache_dir="./cache"   # Custom cache directory
)

# Using custom or fine-tuned models
whisper = WhisperCPP(model_path="/path/to/your/fine-tuned-model.bin")

# The library caches the built whisper.cpp source code
# This means subsequent runs will be faster as compilation is skipped

🐳 Docker support

Docker Instructions
git clone https://github.com/s-emanuilov/whispercpp_kit
cd whispercpp_kit/examples/docker

# Build the image
docker build -t whispercpp_kit .

# Run with default model (base.en)
docker run -v $(pwd):/app/audio whispercpp_kit your_audio.mp3

# Using specific model
docker run -v $(pwd):/app/audio whispercpp_kit your_audio.mp3 tiny.en

See examples/docker/README.md for more details.

📝 License

MIT License - feel free to use in your projects!

🤝 Contributing

Contributions are welcome! Feel free to submit issues and pull requests.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

whispercpp_kit-0.1.3.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

whispercpp_kit-0.1.3-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file whispercpp_kit-0.1.3.tar.gz.

File metadata

  • Download URL: whispercpp_kit-0.1.3.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for whispercpp_kit-0.1.3.tar.gz
Algorithm Hash digest
SHA256 0fc6e8018a7ca03d92b0ff4d609e221d80bab6d5abf7297d7c4ceaa7fc482bb0
MD5 89c25a7b8ddf0bae21305469b7eeb888
BLAKE2b-256 2e6a0bd6b9e9e4611059ca55c3f523b5f90cf97f12aedc1f6236277dcb70c48c

See more details on using hashes here.

File details

Details for the file whispercpp_kit-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: whispercpp_kit-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.7

File hashes

Hashes for whispercpp_kit-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f0267c3daa0764e9edd4dadcba61ea714a9ea1e3ac7977fd8a2617e94cea1ce0
MD5 80b3e0e80321375cb8cf9771d90ab548
BLAKE2b-256 b0847cf50659adb823693f80f40e9f1084fc7c87477f68bb6e830036b221a912

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page