agkphysics commited on
Commit
2c5a8ce
1 Parent(s): 12831ef

Add model files and logs. Update README.

Browse files
README.md CHANGED
@@ -1,3 +1,39 @@
1
  ---
 
 
2
  license: mit
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - am
4
  license: mit
5
+ tags:
6
+ - automatic-speech-recognition
7
+ - speech
8
+ metrics:
9
+ - wer
10
+ - cer
11
  ---
12
+
13
+ # Amharic ASR using fine-tuned Wav2vec2 XLSR-53
14
+ This is a finetuned version of [facebook/wav2vec2-large-xlsr-53](https://huggingface.co/facebook/wav2vec2-large-xlsr-53) trained on the [Amharic Speech Corpus](http://www.openslr.org/25/). This corpus was produced by [Abate et al. (2005)](https://www.isca-speech.org/archive/interspeech_2005/abate05_interspeech.html) (10.21437/Interspeech.2005-467).
15
+
16
+ ## Usage
17
+ The model can be used as follows:
18
+ ```python
19
+ import librosa
20
+ from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
21
+
22
+ model = Wav2Vec2ForCTC.from_pretrained("agkphysics/wav2vec2-large-xlsr-53-amharic")
23
+ processor = Wav2Vec2Processor.from_pretrained("agkphysics/wav2vec2-large-xlsr-53-amharic")
24
+
25
+ audio, _ = librosa.load("/path/to/audio.wav", sr=16000)
26
+
27
+ input_values = processor(
28
+ audio.squeeze(),
29
+ sampling_rate=16000,
30
+ return_tensors="pt"
31
+ ).input_values
32
+
33
+ model.eval()
34
+ with torch.no_grad():
35
+ logits = model(input_values).logits
36
+ preds = logits.argmax(-1)
37
+ texts = processor.batch_decode(preds)
38
+ print(texts[0])
39
+ ```
config.json ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation_dropout": 0.0,
3
+ "adapter_kernel_size": 3,
4
+ "adapter_stride": 2,
5
+ "add_adapter": false,
6
+ "apply_spec_augment": true,
7
+ "architectures": [
8
+ "Wav2Vec2ForCTC"
9
+ ],
10
+ "attention_dropout": 0.1,
11
+ "bos_token_id": 1,
12
+ "classifier_proj_size": 256,
13
+ "codevector_dim": 768,
14
+ "contrastive_logits_temperature": 0.1,
15
+ "conv_bias": true,
16
+ "conv_dim": [
17
+ 512,
18
+ 512,
19
+ 512,
20
+ 512,
21
+ 512,
22
+ 512,
23
+ 512
24
+ ],
25
+ "conv_kernel": [
26
+ 10,
27
+ 3,
28
+ 3,
29
+ 3,
30
+ 3,
31
+ 2,
32
+ 2
33
+ ],
34
+ "conv_stride": [
35
+ 5,
36
+ 2,
37
+ 2,
38
+ 2,
39
+ 2,
40
+ 2,
41
+ 2
42
+ ],
43
+ "ctc_loss_reduction": "mean",
44
+ "ctc_zero_infinity": false,
45
+ "diversity_loss_weight": 0.1,
46
+ "do_stable_layer_norm": true,
47
+ "eos_token_id": 2,
48
+ "feat_extract_activation": "gelu",
49
+ "feat_extract_dropout": 0.0,
50
+ "feat_extract_norm": "layer",
51
+ "feat_proj_dropout": 0.1,
52
+ "feat_quantizer_dropout": 0.0,
53
+ "final_dropout": 0.0,
54
+ "gradient_checkpointing": false,
55
+ "hidden_act": "gelu",
56
+ "hidden_dropout": 0.1,
57
+ "hidden_size": 1024,
58
+ "initializer_range": 0.02,
59
+ "intermediate_size": 4096,
60
+ "layer_norm_eps": 1e-05,
61
+ "layerdrop": 0.1,
62
+ "mask_channel_length": 10,
63
+ "mask_channel_min_space": 1,
64
+ "mask_channel_other": 0.0,
65
+ "mask_channel_prob": 0.0,
66
+ "mask_channel_selection": "static",
67
+ "mask_feature_length": 10,
68
+ "mask_feature_min_masks": 0,
69
+ "mask_feature_prob": 0.0,
70
+ "mask_time_length": 10,
71
+ "mask_time_min_masks": 2,
72
+ "mask_time_min_space": 1,
73
+ "mask_time_other": 0.0,
74
+ "mask_time_prob": 0.075,
75
+ "mask_time_selection": "static",
76
+ "model_type": "wav2vec2",
77
+ "num_adapter_layers": 3,
78
+ "num_attention_heads": 16,
79
+ "num_codevector_groups": 2,
80
+ "num_codevectors_per_group": 320,
81
+ "num_conv_pos_embedding_groups": 16,
82
+ "num_conv_pos_embeddings": 128,
83
+ "num_feat_extract_layers": 7,
84
+ "num_hidden_layers": 24,
85
+ "num_negatives": 100,
86
+ "output_hidden_size": 1024,
87
+ "pad_token_id": 0,
88
+ "proj_codevector_dim": 768,
89
+ "tdnn_dilation": [
90
+ 1,
91
+ 2,
92
+ 3,
93
+ 1,
94
+ 1
95
+ ],
96
+ "tdnn_dim": [
97
+ 512,
98
+ 512,
99
+ 512,
100
+ 512,
101
+ 1500
102
+ ],
103
+ "tdnn_kernel": [
104
+ 5,
105
+ 3,
106
+ 3,
107
+ 1,
108
+ 1
109
+ ],
110
+ "torch_dtype": "float32",
111
+ "transformers_version": "4.26.1",
112
+ "use_weighted_layer_sum": false,
113
+ "vocab_size": 234,
114
+ "xvector_output_dim": 512
115
+ }
optimizer.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:007a6599f2e95d60f7d96669ed2062ca92ee8c71d5172ffa7e4d7cf029c5a63c
3
+ size 2491980485
preprocessor_config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_normalize": true,
3
+ "feature_extractor_type": "Wav2Vec2FeatureExtractor",
4
+ "feature_size": 1,
5
+ "padding_side": "right",
6
+ "padding_value": 0,
7
+ "processor_class": "Wav2Vec2Processor",
8
+ "return_attention_mask": true,
9
+ "sampling_rate": 16000
10
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:19438fd56ddaa550eae67241f7f3bd042315e302dd51388f15c1c713eb49fa36
3
+ size 1262861229
rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0b3a0a5d11e512a58a0b6622a9d1dc932091ce202dcc19cbc4c29834312a3019
3
+ size 17641
runs/May17_11-43-47_hgx1.novalocal/1684280642.7338111/events.out.tfevents.1684280642.hgx1.novalocal.436095.1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:879228333a7024d0ae8074be96899070a111697eac7ad483f90f05cc4d4ec01d
3
+ size 5732
runs/May17_11-43-47_hgx1.novalocal/events.out.tfevents.1684280642.hgx1.novalocal.436095.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b4b52cdefd1977d0d3c1cefc2a4f9ca9fed1a877d37da5d82440393692ec9545
3
+ size 597176
scaler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3a569bd05dae496939d6f816ab83c4619af7025b75bcdb078cd9542c7e570b9a
3
+ size 557
scheduler.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7be0030e8a72dfd3795e709437759f1cfb2fcfdb16e2781eede417e5896550ad
3
+ size 627
special_tokens_map.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<s>",
3
+ "eos_token": "</s>",
4
+ "pad_token": "<pad>",
5
+ "unk_token": "<unk>"
6
+ }
tokenizer_config.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<s>",
3
+ "do_lower_case": false,
4
+ "eos_token": "</s>",
5
+ "model_max_length": 1000000000000000019884624838656,
6
+ "pad_token": "<pad>",
7
+ "processor_class": "Wav2Vec2Processor",
8
+ "replace_word_delimiter_char": " ",
9
+ "tokenizer_class": "Wav2Vec2CTCTokenizer",
10
+ "unk_token": "<unk>",
11
+ "word_delimiter_token": " "
12
+ }
trainer_state.json ADDED
The diff for this file is too large to render. See raw diff
 
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9af8d0388d3afd7f7d0062165b3d2429f1fd23b1ebee144559698a59b949ead2
3
+ size 3515
vocab.json ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ " ": 4,
3
+ "</s>": 2,
4
+ "<pad>": 0,
5
+ "<s>": 1,
6
+ "<unk>": 3,
7
+ "ሀ": 5,
8
+ "ሁ": 6,
9
+ "ሂ": 7,
10
+ "ሃ": 8,
11
+ "ሄ": 9,
12
+ "ህ": 10,
13
+ "ሆ": 11,
14
+ "ለ": 12,
15
+ "ሉ": 13,
16
+ "ሊ": 14,
17
+ "ላ": 15,
18
+ "ሌ": 16,
19
+ "ል": 17,
20
+ "ሎ": 18,
21
+ "ሏ": 19,
22
+ "መ": 20,
23
+ "ሙ": 21,
24
+ "ሚ": 22,
25
+ "ማ": 23,
26
+ "ሜ": 24,
27
+ "ም": 25,
28
+ "ሞ": 26,
29
+ "ሟ": 27,
30
+ "ረ": 28,
31
+ "ሩ": 29,
32
+ "ሪ": 30,
33
+ "ራ": 31,
34
+ "ሬ": 32,
35
+ "ር": 33,
36
+ "ሮ": 34,
37
+ "ሯ": 35,
38
+ "ሰ": 36,
39
+ "ሱ": 37,
40
+ "ሲ": 38,
41
+ "ሳ": 39,
42
+ "ሴ": 40,
43
+ "ስ": 41,
44
+ "ሶ": 42,
45
+ "ሷ": 43,
46
+ "ሸ": 44,
47
+ "ሹ": 45,
48
+ "ሺ": 46,
49
+ "ሻ": 47,
50
+ "ሼ": 48,
51
+ "ሽ": 49,
52
+ "ሾ": 50,
53
+ "ሿ": 51,
54
+ "ቀ": 52,
55
+ "ቁ": 53,
56
+ "ቂ": 54,
57
+ "ቃ": 55,
58
+ "ቄ": 56,
59
+ "ቅ": 57,
60
+ "ቆ": 58,
61
+ "ቋ": 59,
62
+ "በ": 60,
63
+ "ቡ": 61,
64
+ "ቢ": 62,
65
+ "ባ": 63,
66
+ "ቤ": 64,
67
+ "ብ": 65,
68
+ "ቦ": 66,
69
+ "ቧ": 67,
70
+ "ቨ": 68,
71
+ "ቩ": 69,
72
+ "ቪ": 70,
73
+ "ቫ": 71,
74
+ "ቬ": 72,
75
+ "ቭ": 73,
76
+ "ቮ": 74,
77
+ "ቯ": 75,
78
+ "ተ": 76,
79
+ "ቱ": 77,
80
+ "ቲ": 78,
81
+ "ታ": 79,
82
+ "ቴ": 80,
83
+ "ት": 81,
84
+ "ቶ": 82,
85
+ "ቷ": 83,
86
+ "ቸ": 84,
87
+ "ቹ": 85,
88
+ "ቺ": 86,
89
+ "ቻ": 87,
90
+ "ቼ": 88,
91
+ "ች": 89,
92
+ "ቾ": 90,
93
+ "ቿ": 91,
94
+ "ኋ": 92,
95
+ "ነ": 93,
96
+ "ኑ": 94,
97
+ "ኒ": 95,
98
+ "ና": 96,
99
+ "ኔ": 97,
100
+ "ን": 98,
101
+ "ኖ": 99,
102
+ "ኗ": 100,
103
+ "ኘ": 101,
104
+ "ኙ": 102,
105
+ "ኚ": 103,
106
+ "ኛ": 104,
107
+ "ኜ": 105,
108
+ "ኝ": 106,
109
+ "ኞ": 107,
110
+ "ኟ": 108,
111
+ "አ": 109,
112
+ "ኡ": 110,
113
+ "ኢ": 111,
114
+ "ኣ": 112,
115
+ "ኤ": 113,
116
+ "እ": 114,
117
+ "ኦ": 115,
118
+ "ከ": 116,
119
+ "ኩ": 117,
120
+ "ኪ": 118,
121
+ "ካ": 119,
122
+ "ኬ": 120,
123
+ "ክ": 121,
124
+ "ኮ": 122,
125
+ "ኰ": 123,
126
+ "ኲ": 124,
127
+ "ኳ": 125,
128
+ "ኸ": 126,
129
+ "ወ": 127,
130
+ "ዉ": 128,
131
+ "ዊ": 129,
132
+ "ዋ": 130,
133
+ "ዌ": 131,
134
+ "ው": 132,
135
+ "ዎ": 133,
136
+ "ዘ": 134,
137
+ "ዙ": 135,
138
+ "ዚ": 136,
139
+ "ዛ": 137,
140
+ "ዜ": 138,
141
+ "ዝ": 139,
142
+ "ዞ": 140,
143
+ "ዟ": 141,
144
+ "ዠ": 142,
145
+ "ዡ": 143,
146
+ "ዢ": 144,
147
+ "ዣ": 145,
148
+ "ዤ": 146,
149
+ "ዥ": 147,
150
+ "ዦ": 148,
151
+ "ዧ": 149,
152
+ "የ": 150,
153
+ "ዩ": 151,
154
+ "ዪ": 152,
155
+ "ያ": 153,
156
+ "ዬ": 154,
157
+ "ይ": 155,
158
+ "ዮ": 156,
159
+ "ደ": 157,
160
+ "ዱ": 158,
161
+ "ዲ": 159,
162
+ "ዳ": 160,
163
+ "ዴ": 161,
164
+ "ድ": 162,
165
+ "ዶ": 163,
166
+ "ዷ": 164,
167
+ "ዸ": 165,
168
+ "ዺ": 166,
169
+ "ዻ": 167,
170
+ "ዼ": 168,
171
+ "ዽ": 169,
172
+ "ዾ": 170,
173
+ "ጀ": 171,
174
+ "ጁ": 172,
175
+ "ጂ": 173,
176
+ "ጃ": 174,
177
+ "ጄ": 175,
178
+ "ጅ": 176,
179
+ "ጆ": 177,
180
+ "ጇ": 178,
181
+ "ገ": 179,
182
+ "ጉ": 180,
183
+ "ጊ": 181,
184
+ "ጋ": 182,
185
+ "ጌ": 183,
186
+ "ግ": 184,
187
+ "ጐ": 185,
188
+ "ጓ": 186,
189
+ "ጔ": 187,
190
+ "ጠ": 188,
191
+ "ጡ": 189,
192
+ "ጢ": 190,
193
+ "ጣ": 191,
194
+ "ጤ": 192,
195
+ "ጥ": 193,
196
+ "ጦ": 194,
197
+ "ጧ": 195,
198
+ "ጨ": 196,
199
+ "ጩ": 197,
200
+ "ጪ": 198,
201
+ "ጫ": 199,
202
+ "ጬ": 200,
203
+ "ጭ": 201,
204
+ "ጮ": 202,
205
+ "ጯ": 203,
206
+ "ጰ": 204,
207
+ "ጱ": 205,
208
+ "ጲ": 206,
209
+ "ጳ": 207,
210
+ "ጴ": 208,
211
+ "ጵ": 209,
212
+ "ጶ": 210,
213
+ "ጸ": 211,
214
+ "ጹ": 212,
215
+ "ጺ": 213,
216
+ "ጻ": 214,
217
+ "ጼ": 215,
218
+ "ጽ": 216,
219
+ "ጾ": 217,
220
+ "ጿ": 218,
221
+ "ፈ": 219,
222
+ "ፉ": 220,
223
+ "ፊ": 221,
224
+ "ፋ": 222,
225
+ "ፌ": 223,
226
+ "ፍ": 224,
227
+ "ፎ": 225,
228
+ "ፏ": 226,
229
+ "ፐ": 227,
230
+ "ፑ": 228,
231
+ "ፒ": 229,
232
+ "ፓ": 230,
233
+ "ፔ": 231,
234
+ "ፕ": 232,
235
+ "ፖ": 233
236
+ }