use llm to transcribe swahili audio
# Swahili Audio Transcription
A Python tool for transcribing Swahili audio files to text using OpenAI's Whisper model with CUDA acceleration support.
## Features
- 🎯 **Optimized for Swahili**: Pre-configured for Swahili language transcription
- 🚀 **CUDA Support**: Automatic GPU acceleration when available
- 🔧 **Flexible Configuration**: Multiple model sizes and customization options
- 📁 **Batch Processing**: Transcribe multiple files at once
- 🖥️ **CLI Interface**: Easy-to-use command-line interface
- 📝 **Multiple Output Formats**: Text files with automatic naming
- 🔍 **Device Information**: Check CUDA availability and device specs
## Installation
### Prerequisites
- Python 3.8 or higher
- CUDA-compatible GPU (optional, for acceleration)
- FFmpeg (for audio processing)
### Install FFmpeg
#### Ubuntu/Debian
```bash
sudo apt update
sudo apt install ffmpeg
```
#### macOS
```bash
brew install ffmpeg
```
#### Windows
Download from FFmpeg official website or use chocolatey:
```bash
choco install ffmpeg
```
### Install the Package
1. Clone the repository:
```bash
git clone
cd swahili-transcription
```
2. Install dependencies:
```bash
pip install -r requirements.txt
```
3. Install the package in development mode:
```bash
pip install -e .
```
### CUDA Setup (Optional)
For GPU acceleration, ensure you have:
- CUDA Toolkit installed
- Compatible PyTorch with CUDA support
Install PyTorch with CUDA:
```bash
pip install torch torchaudio --index-url
download.pytorch.org
```
## Usage
### Command Line Interface
#### Basic Transcription
```bash
swahili-transcribe audio.wav
```
This will create `audio.txt` with the transcription.
#### Specify Output File
```bash
swahili-transcribe audio.wav -o transcription.txt
```
#### Use Different Model Size
```bash
swahili-transcribe audio.wav -m large
```
Available models: `tiny`, `base`, `small`, `medium`, `large`, `large-v2`, `large-v3`
#### Force CPU Usage
```bash
swahili-transcribe audio.wav -d c …