--- library_name: peft pipeline_tag: automatic-speech-recognition language: - bm - fr - en tags: - lora - peft - whisper - automatic-speech-recognition - tensorboard datasets: - djelia/bambara-asr - djelia/bambara-synthetic-audio - djelia/bambara-audio-b - sudoping01/bambara-speech-recognition-benchmark --- # bm-whisper-large-v4-training-bm-lora-3c A decoder-only, rank-8 LoRA adapter for Bambara speech recognition, sized for Whisper large-v3 geometry: hidden size 1280, 32 encoder + 32 decoder layers, 128 mel bins, 51,866-token vocabulary. Adapter weights only. The base checkpoint is not recorded in this repo, so supply your own Whisper large-v3-geometry model when loading. ## Usage ```python from peft import PeftModel from transformers import WhisperForConditionalGeneration, WhisperProcessor base = WhisperForConditionalGeneration.from_pretrained(YOUR_BASE_MODEL) model = PeftModel.from_pretrained(base, "djelia/bm-whisper-large-v4-training-bm-lora-3c") model.eval() # tokenizer and feature extractor ship with the adapter processor = WhisperProcessor.from_pretrained("djelia/bm-whisper-large-v4-training-bm-lora-3c") # Optional: fold the LoRA deltas into the base weights for inference. # merged = model.merge_and_unload() ``` ## Adapter configuration | Key | Value | |---|---| | `peft_type` | `LORA` | | `r` / `lora_alpha` | 8 / 8 (scaling 1.0) | | `lora_dropout` | 0.05 | | `bias` / `lora_bias` | `none` / false | | `target_modules` | regex `model.decoder.layers.[\d]+.(self_attn\|encoder_attn).(q_proj\|k_proj\|v_proj\|out_proj)` | | Trainable parameters | 5,242,880 | | Adapter dtype | F32 | ## Notes `target_modules` is a regex scoped to `model.decoder.layers`, so the adapter covers decoder self-attention and cross-attention `q/k/v/out_proj` across all 32 decoder layers (512 tensors) and nothing else. The encoder, every MLP block, all embeddings and all layer norms are untouched: the acoustic representation is inherited from the base. Audio should be 16 kHz mono.