whispercpp-kit


Namewhispercpp-kit JSON
Version 0.1.4 PyPI version JSON
download
home_pageNone
SummaryA toolkit for whisper.cpp with audio processing and model management
upload_time2025-01-07 18:22:55
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT License Copyright (c) 2024 Simeon Emanuilov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 2. When using or distributing the Software, proper attribution must be given to the original author by citing the project name "whispercpp_kit" and its source. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords whisper speech-to-text audio transcription
VCS
bugtrack_url
requirements python-ffmpeg
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # WhisperCPP Kit ๐ŸŽ™๏ธ

[![PyPI version](https://badge.fury.io/py/whispercpp-kit.svg)](https://badge.fury.io/py/whispercpp-kit)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

> ๐Ÿš€ A Python wrapper around [whisper.cpp](https://github.com/ggerganov/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 ๐Ÿ“ฆ

<details>
<summary>Ubuntu/Debian</summary>

```bash
sudo apt update
sudo apt install git cmake ffmpeg build-essential
```
</details>

<details>
<summary>MacOS</summary>

```bash
brew install git cmake ffmpeg gcc make
```
</details>

<details>
<summary>CentOS/RHEL</summary>

```bash
sudo yum update
sudo yum groupinstall "Development Tools"
sudo yum install git cmake ffmpeg gcc-c++ make
```
</details>

> โš ๏ธ Windows is currently not supported. Please use WSL (Windows Subsystem for Linux) with Ubuntu.

## ๐Ÿš€ Quick start

### Installation

```bash
pip install whispercpp_kit
```

### Basic usage

```python
from whispercpp_kit import WhisperCPP

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

# First-time setup (automatically done on first transcribe)
whisper.setup()

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

### Advanced configuration

```python
# 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
```

## ๐Ÿณ Troubleshooting

### Rebuilding whisper.cpp

If you encounter issues with the whisper.cpp binary, you can force a rebuild:

```python
import shutil
from whispercpp_kit import WhisperCPP

whisper = WhisperCPP(model_name="tiny.en")
# Force rebuild of whisper.cpp
shutil.rmtree(whisper.base_path)
whisper.setup()
```

### Common Issues

1. **Binary Deprecation Warning**: If you see a warning about the 'main' binary being deprecated, rebuild whisper.cpp using the steps above. The latest version uses 'whisper-cli' instead.

2. **Transcription Failures**: Ensure you have all required dependencies installed and sufficient permissions to execute the binary.

3. **Audio Format Issues**: The library automatically converts audio files using ffmpeg. Make sure ffmpeg is properly installed if you encounter audio-related errors.

## ๐Ÿณ Docker support

<details>
<summary>Docker Instructions</summary>

```bash
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](examples/docker/README.md) for more details.
</details>

## ๐Ÿ“ License

MIT License - feel free to use in your projects!

## ๐Ÿค Contributing

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

##

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "whispercpp-kit",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "whisper, speech-to-text, audio, transcription",
    "author": null,
    "author_email": "Simeon Emanuilov <simeon.emanuilov@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/44/c2/88c224e2acaaba486ae14471fe05241e0ed3eb23e74bca105dd485d30cbc/whispercpp_kit-0.1.4.tar.gz",
    "platform": null,
    "description": "# WhisperCPP Kit \ud83c\udf99\ufe0f\n\n[![PyPI version](https://badge.fury.io/py/whispercpp-kit.svg)](https://badge.fury.io/py/whispercpp-kit)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n> \ud83d\ude80 A Python wrapper around [whisper.cpp](https://github.com/ggerganov/whisper.cpp) with model management and helper features.\n\n## \u2728 Features\n\n- \ud83d\udd04 Automatic building and setup of whisper.cpp\n- \ud83c\udfaf Simple, intuitive Python API\n- \ud83d\udd27 Built-in model management\n- \ud83d\udea6 Clear error messages and dependency checks\n- \ud83c\udfb5 Automatic audio format conversion\n- \ud83e\uddf5 Multi-threading support\n- \ud83d\udc33 Docker support\n- \ud83c\udfaf Support for custom and fine-tuned models\n- \u26a1 Cached builds for faster subsequent inference\n\n## \ud83d\udccb System Requirements\n\nBefore installing `whispercpp_kit`, ensure you have these system-level dependencies:\n\n### Required dependencies \ud83d\udee0\ufe0f\n\n- `git`\n- `cmake`\n- `ffmpeg`\n- `make`\n- `g++`/`gcc` (C++ compiler)\n- Build essentials\n\n### Installation commands \ud83d\udce6\n\n<details>\n<summary>Ubuntu/Debian</summary>\n\n```bash\nsudo apt update\nsudo apt install git cmake ffmpeg build-essential\n```\n</details>\n\n<details>\n<summary>MacOS</summary>\n\n```bash\nbrew install git cmake ffmpeg gcc make\n```\n</details>\n\n<details>\n<summary>CentOS/RHEL</summary>\n\n```bash\nsudo yum update\nsudo yum groupinstall \"Development Tools\"\nsudo yum install git cmake ffmpeg gcc-c++ make\n```\n</details>\n\n> \u26a0\ufe0f Windows is currently not supported. Please use WSL (Windows Subsystem for Linux) with Ubuntu.\n\n## \ud83d\ude80 Quick start\n\n### Installation\n\n```bash\npip install whispercpp_kit\n```\n\n### Basic usage\n\n```python\nfrom whispercpp_kit import WhisperCPP\n\n# Initialize with default model\nwhisper = WhisperCPP(model_name=\"tiny.en\")\n\n# First-time setup (automatically done on first transcribe)\nwhisper.setup()\n\n# Transcribe audio\ntext = whisper.transcribe(\"audio.mp3\")\nprint(text)\n```\n\n### Advanced configuration\n\n```python\n# Using standard models\nwhisper = WhisperCPP(\n    model_name=\"tiny.en\",\n    num_threads=8,        # Control threads number\n    verbose=True,         # Enable verbose output\n    cache_dir=\"./cache\"   # Custom cache directory\n)\n\n# Using custom or fine-tuned models\nwhisper = WhisperCPP(model_path=\"/path/to/your/fine-tuned-model.bin\")\n\n# The library caches the built whisper.cpp source code\n# This means subsequent runs will be faster as compilation is skipped\n```\n\n## \ud83d\udc33 Troubleshooting\n\n### Rebuilding whisper.cpp\n\nIf you encounter issues with the whisper.cpp binary, you can force a rebuild:\n\n```python\nimport shutil\nfrom whispercpp_kit import WhisperCPP\n\nwhisper = WhisperCPP(model_name=\"tiny.en\")\n# Force rebuild of whisper.cpp\nshutil.rmtree(whisper.base_path)\nwhisper.setup()\n```\n\n### Common Issues\n\n1. **Binary Deprecation Warning**: If you see a warning about the 'main' binary being deprecated, rebuild whisper.cpp using the steps above. The latest version uses 'whisper-cli' instead.\n\n2. **Transcription Failures**: Ensure you have all required dependencies installed and sufficient permissions to execute the binary.\n\n3. **Audio Format Issues**: The library automatically converts audio files using ffmpeg. Make sure ffmpeg is properly installed if you encounter audio-related errors.\n\n## \ud83d\udc33 Docker support\n\n<details>\n<summary>Docker Instructions</summary>\n\n```bash\ngit clone https://github.com/s-emanuilov/whispercpp_kit\ncd whispercpp_kit/examples/docker\n\n# Build the image\ndocker build -t whispercpp_kit .\n\n# Run with default model (base.en)\ndocker run -v $(pwd):/app/audio whispercpp_kit your_audio.mp3\n\n# Using specific model\ndocker run -v $(pwd):/app/audio whispercpp_kit your_audio.mp3 tiny.en\n```\n\nSee [examples/docker/README.md](examples/docker/README.md) for more details.\n</details>\n\n## \ud83d\udcdd License\n\nMIT License - feel free to use in your projects!\n\n## \ud83e\udd1d Contributing\n\nContributions are welcome! Feel free to submit issues and pull requests.\n\n##\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Simeon Emanuilov  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  2. When using or distributing the Software, proper attribution must be given to the original author by citing the project name \"whispercpp_kit\" and its source.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "A toolkit for whisper.cpp with audio processing and model management",
    "version": "0.1.4",
    "project_urls": {
        "Homepage": "https://github.com/s-emanuilov/whispercpp_kit"
    },
    "split_keywords": [
        "whisper",
        " speech-to-text",
        " audio",
        " transcription"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "122ea941b3dff35dcf018fd6036e27d20890142c7d7ccb74d0d3b3b2f9756ccc",
                "md5": "f5c68502a0734dcf9cf44ae1f2e2d256",
                "sha256": "0a8f275fd3c005029a6ccda1c1f98ceeb9932b21c00eb4628d182dc8d79038dd"
            },
            "downloads": -1,
            "filename": "whispercpp_kit-0.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f5c68502a0734dcf9cf44ae1f2e2d256",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 7801,
            "upload_time": "2025-01-07T18:22:52",
            "upload_time_iso_8601": "2025-01-07T18:22:52.342990Z",
            "url": "https://files.pythonhosted.org/packages/12/2e/a941b3dff35dcf018fd6036e27d20890142c7d7ccb74d0d3b3b2f9756ccc/whispercpp_kit-0.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "44c288c224e2acaaba486ae14471fe05241e0ed3eb23e74bca105dd485d30cbc",
                "md5": "ff589f8c2772e914e94a2afe2510ba8d",
                "sha256": "cc3f2de34ec55a9e66a65c4b693cfea638a2703b2a203494a43f66592633f1cf"
            },
            "downloads": -1,
            "filename": "whispercpp_kit-0.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "ff589f8c2772e914e94a2afe2510ba8d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 7758,
            "upload_time": "2025-01-07T18:22:55",
            "upload_time_iso_8601": "2025-01-07T18:22:55.222712Z",
            "url": "https://files.pythonhosted.org/packages/44/c2/88c224e2acaaba486ae14471fe05241e0ed3eb23e74bca105dd485d30cbc/whispercpp_kit-0.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-07 18:22:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "s-emanuilov",
    "github_project": "whispercpp_kit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "python-ffmpeg",
            "specs": [
                [
                    "==",
                    "2.0.12"
                ]
            ]
        }
    ],
    "lcname": "whispercpp-kit"
}
        
Elapsed time: 0.39016s