# Dikkte ASR
Wolof speech-to-text. Fine-tunes Whisper small with LoRA, merges the adapter, and gives you a standard `transformers` model you can load in two lines.
Wolof is spoken by 10M+ people across Senegal, Gambia, and Mauritania — but barely has any open ASR tools. This project fixes that.
## Install
```bash
git clone
github.com
cd dikkte_asr
pip install -r requirements.txt
```
## Usage
### From HuggingFace (easiest)
```bash
pip install transformers torch torchaudio
```
```python
from transformers import pipeline
pipe = pipeline("automatic-speech-recognition", model="utachicodes/dikkte-wolof-asr")
print(pipe("audio.wav")["text"])
```
### Load the model directly
```python
from transformers import WhisperForConditionalGeneration, WhisperProcessor
import torchaudio, torch
processor = WhisperProcessor.from_pretrained("utachicodes/dikkte-wolof-asr")
model = WhisperForConditionalGeneration.from_pretrained("utachicodes/dikkte-wolof-asr")
model.eval()
waveform, sr = torchaudio.load("audio.wav")
if sr != 16000:
waveform = torchaudio.transforms.Resample(sr, 16000)(waveform)
inputs = processor(waveform.squeeze().numpy(), sampling_rate=16000, return_tensors="pt")
with torch.no_grad():
ids = model.generate(input_features=inputs.input_features)
print(processor.batch_decode(ids, skip_special_tokens=True)[0])
```
### Web UI (mic input)
```bash
python wolof_stt.py
# opens at
127.0.0.1
```
Record from your mic, hit transcribe. Long audio gets chunked into 30s segments.
### Use the raw LoRA adapter
If you want to apply the adapter yourself instead of using the merged model:
```python
from transformers import WhisperForConditionalGeneration, WhisperProcessor
from peft import PeftModel
base = WhisperForConditionalGeneration.from_pretrained("openai/whisper-small")
model = PeftModel.from_pretrained(base, "./wolof-whisper-small-lora")
model = model.merge_and_unload()
```
## Training
| | |
|---|---|
| Base model | `o …