Sadou commited on
Commit
9af1f0f
·
verified ·
1 Parent(s): b7a8fda

MMS-1B Wolof fine-tuned - WER 29.56% (full fine-tune, 20k samples)

Browse files
Files changed (8) hide show
  1. README.md +161 -0
  2. config.json +108 -0
  3. metrics.json +12 -0
  4. model.safetensors +3 -0
  5. processor_config.json +12 -0
  6. tokenizer_config.json +54 -0
  7. training_args.bin +3 -0
  8. vocab.json +0 -0
README.md ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: wo
3
+ license: apache-2.0
4
+ tags:
5
+ - automatic-speech-recognition
6
+ - audio
7
+ - wolof
8
+ - mms
9
+ - senegal
10
+ - africa
11
+ - low-resource
12
+ datasets:
13
+ - vonewman/wolof-audio-data
14
+ metrics:
15
+ - wer
16
+ base_model: facebook/mms-1b-all
17
+ model-index:
18
+ - name: mms-1b-wolof-finetuned
19
+ results:
20
+ - task:
21
+ type: automatic-speech-recognition
22
+ name: Automatic Speech Recognition
23
+ dataset:
24
+ name: vonewman/wolof-audio-data
25
+ type: vonewman/wolof-audio-data
26
+ metrics:
27
+ - type: wer
28
+ value: 29.56
29
+ name: Word Error Rate
30
+ ---
31
+
32
+ # MMS-1B Wolof Fine-Tuned 🇸🇳
33
+
34
+ Fine-tuned version of [facebook/mms-1b-all](https://huggingface.co/facebook/mms-1b-all) for **Wolof Automatic Speech Recognition (ASR)**.
35
+
36
+ This model transcribes Wolof speech audio into Wolof text. It's the result of full fine-tuning (all 964M parameters) on 20,000 quality-filtered audio samples.
37
+
38
+ ## 📊 Performance
39
+
40
+ | Metric | Value |
41
+ |--------|-------|
42
+ | **WER (Word Error Rate)** | **29.56%** |
43
+ | Test set | 500 examples |
44
+ | Training samples | 20,000 |
45
+ | Total audio | 25.6 hours |
46
+ | Mode | Full fine-tuning (964M params) |
47
+
48
+ ## 🎯 Use Cases
49
+
50
+ - 🎙️ Transcription of Wolof audio (radio, podcasts, conversations)
51
+ - 🌍 First step in a Wolof → French translation pipeline
52
+ - ♿ Accessibility tools for Wolof-speaking communities
53
+ - 🔬 Research on low-resource African languages
54
+
55
+ ## 🚀 Quick Start
56
+
57
+ ```python
58
+ from transformers import Wav2Vec2ForCTC, AutoProcessor
59
+ import torch
60
+ import torchaudio
61
+
62
+ # Load model and processor
63
+ model_id = "Sadou/mms-1b-wolof-finetuned"
64
+ processor = AutoProcessor.from_pretrained(model_id)
65
+ model = Wav2Vec2ForCTC.from_pretrained(model_id)
66
+
67
+ # Load audio (must be 16kHz, mono)
68
+ waveform, sr = torchaudio.load("your_audio.wav")
69
+ if sr != 16000:
70
+ waveform = torchaudio.transforms.Resample(sr, 16000)(waveform)
71
+ if waveform.shape[0] > 1:
72
+ waveform = waveform.mean(dim=0, keepdim=True)
73
+
74
+ # Transcribe
75
+ inputs = processor(waveform[0].numpy(), sampling_rate=16000, return_tensors="pt")
76
+
77
+ with torch.no_grad():
78
+ logits = model(**inputs).logits
79
+
80
+ predicted_ids = torch.argmax(logits, dim=-1)
81
+ transcription = processor.batch_decode(predicted_ids)[0]
82
+ print(f"Transcription: {transcription}")
83
+ ```
84
+
85
+ ## 📈 Training Details
86
+
87
+ ### Dataset
88
+ - **Source**: [vonewman/wolof-audio-data](https://huggingface.co/datasets/vonewman/wolof-audio-data)
89
+ - **Combines**: ALFFA + FLEURS + Urban Bus + Kallama
90
+ - **Quality filters applied**:
91
+ - Audio duration: 2-15s
92
+ - Text: 3-30 words
93
+ - Speech rate: 1.0-4.5 words/sec
94
+ - Retention rate: 75.5%
95
+
96
+ ### Training Configuration
97
+ - **Base model**: `facebook/mms-1b-all`
98
+ - **Mode**: Full fine-tuning (all 964M parameters)
99
+ - **Precision**: bf16 (Brain Float 16)
100
+ - **Effective batch size**: 32 (16 × 2 gradient accumulation)
101
+ - **Gradient checkpointing**: Enabled
102
+ - **Learning rate**: 3e-5 (initial), then 5e-6 (final epochs)
103
+ - **Epochs**: 6 (4 + 2 with LR decay)
104
+ - **Hardware**: NVIDIA RTX PRO 6000 Blackwell
105
+
106
+ ### Training Progression
107
+
108
+ | Step | WER | Phase |
109
+ |------|-----|-------|
110
+ | 300 | 47.67% | Initial training |
111
+ | 900 | 38.86% | |
112
+ | 1500 | 33.35% | |
113
+ | 2100 | 30.77% | |
114
+ | 2400 | 30.11% | Plateau detected |
115
+ | 2700 | 30.56% | LR decay started |
116
+ | 3300 | 29.56% | |
117
+ | 3600 | **29.56%** | Final ✅ |
118
+
119
+ ## ⚠️ Limitations
120
+
121
+ - **Code-switching**: Difficulty with French words mixed in Wolof speech
122
+ - **Word segmentation**: Sometimes merges or splits words incorrectly
123
+ - **Background noise**: Performance degrades on noisy audio
124
+ - **Long audios**: For audios > 30s, use chunking with stride
125
+
126
+ ## 🔄 Long Audio Inference
127
+
128
+ For audios longer than 30 seconds, use HuggingFace pipeline with chunking:
129
+
130
+ ```python
131
+ from transformers import pipeline
132
+
133
+ pipe = pipeline(
134
+ 'automatic-speech-recognition',
135
+ model="Sadou/mms-1b-wolof-finetuned",
136
+ chunk_length_s=30,
137
+ stride_length_s=(4, 2),
138
+ device=0,
139
+ )
140
+
141
+ result = pipe("long_audio.wav")
142
+ print(result['text'])
143
+ ```
144
+
145
+ ## 🙏 Acknowledgments
146
+
147
+ - Meta AI for [MMS](https://huggingface.co/facebook/mms-1b-all)
148
+ - [vonewman](https://huggingface.co/vonewman) for the Wolof audio dataset
149
+ - [GalsenAI](https://huggingface.co/galsenai) and the Senegalese AI community
150
+
151
+ ## 📚 Citation
152
+
153
+ ```bibtex
154
+ @misc{wolof-mms-2026,
155
+ author = {Sadou Barry},
156
+ title = {MMS-1B Wolof Fine-Tuned},
157
+ year = {2026},
158
+ publisher = {HuggingFace},
159
+ url = {https://huggingface.co/Sadou/mms-1b-wolof-finetuned}
160
+ }
161
+ ```
config.json ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation_dropout": 0.05,
3
+ "adapter_attn_dim": 16,
4
+ "adapter_kernel_size": 3,
5
+ "adapter_stride": 2,
6
+ "add_adapter": false,
7
+ "apply_spec_augment": true,
8
+ "architectures": [
9
+ "Wav2Vec2ForCTC"
10
+ ],
11
+ "attention_dropout": 0.05,
12
+ "bos_token_id": 1,
13
+ "classifier_proj_size": 256,
14
+ "codevector_dim": 1024,
15
+ "contrastive_logits_temperature": 0.1,
16
+ "conv_bias": true,
17
+ "conv_dim": [
18
+ 512,
19
+ 512,
20
+ 512,
21
+ 512,
22
+ 512,
23
+ 512,
24
+ 512
25
+ ],
26
+ "conv_kernel": [
27
+ 10,
28
+ 3,
29
+ 3,
30
+ 3,
31
+ 3,
32
+ 2,
33
+ 2
34
+ ],
35
+ "conv_stride": [
36
+ 5,
37
+ 2,
38
+ 2,
39
+ 2,
40
+ 2,
41
+ 2,
42
+ 2
43
+ ],
44
+ "ctc_loss_reduction": "mean",
45
+ "ctc_zero_infinity": false,
46
+ "diversity_loss_weight": 0.1,
47
+ "do_stable_layer_norm": true,
48
+ "dtype": "float32",
49
+ "eos_token_id": 2,
50
+ "feat_extract_activation": "gelu",
51
+ "feat_extract_dropout": 0.0,
52
+ "feat_extract_norm": "layer",
53
+ "feat_proj_dropout": 0.05,
54
+ "feat_quantizer_dropout": 0.0,
55
+ "final_dropout": 0.05,
56
+ "hidden_act": "gelu",
57
+ "hidden_dropout": 0.05,
58
+ "hidden_size": 1280,
59
+ "initializer_range": 0.02,
60
+ "intermediate_size": 5120,
61
+ "layer_norm_eps": 1e-05,
62
+ "layerdrop": 0.05,
63
+ "mask_feature_length": 10,
64
+ "mask_feature_min_masks": 0,
65
+ "mask_feature_prob": 0.0,
66
+ "mask_time_length": 10,
67
+ "mask_time_min_masks": 2,
68
+ "mask_time_prob": 0.05,
69
+ "model_type": "wav2vec2",
70
+ "num_adapter_layers": 3,
71
+ "num_attention_heads": 16,
72
+ "num_codevector_groups": 2,
73
+ "num_codevectors_per_group": 320,
74
+ "num_conv_pos_embedding_groups": 16,
75
+ "num_conv_pos_embeddings": 128,
76
+ "num_feat_extract_layers": 7,
77
+ "num_hidden_layers": 48,
78
+ "num_negatives": 100,
79
+ "output_hidden_size": 1280,
80
+ "pad_token_id": 0,
81
+ "proj_codevector_dim": 1024,
82
+ "tdnn_dilation": [
83
+ 1,
84
+ 2,
85
+ 3,
86
+ 1,
87
+ 1
88
+ ],
89
+ "tdnn_dim": [
90
+ 512,
91
+ 512,
92
+ 512,
93
+ 512,
94
+ 1500
95
+ ],
96
+ "tdnn_kernel": [
97
+ 5,
98
+ 3,
99
+ 3,
100
+ 1,
101
+ 1
102
+ ],
103
+ "transformers_version": "5.0.0",
104
+ "use_cache": false,
105
+ "use_weighted_layer_sum": false,
106
+ "vocab_size": 87,
107
+ "xvector_output_dim": 512
108
+ }
metrics.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "final_wer": 0.2956,
3
+ "train_size": 20000,
4
+ "test_size": 500,
5
+ "epochs": 6,
6
+ "mode": "full_fine_tune",
7
+ "lr_initial": 3e-05,
8
+ "lr_final": 5e-06,
9
+ "base_model": "facebook/mms-1b-all",
10
+ "language": "wol",
11
+ "dataset": "vonewman/wolof-audio-data"
12
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:11559aacad0861f7fd06e1ebe56bdb7d0ed5e522b0935716fd86aaddb9b452a7
3
+ size 3859177812
processor_config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "feature_extractor": {
3
+ "do_normalize": true,
4
+ "feature_extractor_type": "Wav2Vec2FeatureExtractor",
5
+ "feature_size": 1,
6
+ "padding_side": "right",
7
+ "padding_value": 0,
8
+ "return_attention_mask": true,
9
+ "sampling_rate": 16000
10
+ },
11
+ "processor_class": "Wav2Vec2Processor"
12
+ }
tokenizer_config.json ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "<pad>",
5
+ "lstrip": true,
6
+ "normalized": false,
7
+ "rstrip": true,
8
+ "single_word": false,
9
+ "special": false
10
+ },
11
+ "1": {
12
+ "content": "<s>",
13
+ "lstrip": true,
14
+ "normalized": false,
15
+ "rstrip": true,
16
+ "single_word": false,
17
+ "special": false
18
+ },
19
+ "2": {
20
+ "content": "</s>",
21
+ "lstrip": true,
22
+ "normalized": false,
23
+ "rstrip": true,
24
+ "single_word": false,
25
+ "special": false
26
+ },
27
+ "3": {
28
+ "content": "<unk>",
29
+ "lstrip": true,
30
+ "normalized": false,
31
+ "rstrip": true,
32
+ "single_word": false,
33
+ "special": false
34
+ }
35
+ },
36
+ "additional_special_tokens": null,
37
+ "backend": "custom",
38
+ "bos_token": "<s>",
39
+ "clean_up_tokenization_spaces": true,
40
+ "do_lower_case": false,
41
+ "eos_token": "</s>",
42
+ "is_local": false,
43
+ "model_max_length": 1000000000000000019884624838656,
44
+ "model_specific_special_tokens": {
45
+ "word_delimiter_token": "|"
46
+ },
47
+ "pad_token": "<pad>",
48
+ "processor_class": "Wav2Vec2Processor",
49
+ "replace_word_delimiter_char": " ",
50
+ "target_lang": "wol",
51
+ "tokenizer_class": "Wav2Vec2CTCTokenizer",
52
+ "unk_token": "<unk>",
53
+ "word_delimiter_token": "|"
54
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7ccb3f489033d1906cbdc076b633aa8f5ce73efa6e7f0d5411b18e507b91d409
3
+ size 5137
vocab.json ADDED
The diff for this file is too large to render. See raw diff