CollectionStudio kunaldhawan commited on
Commit
96fc16b
·
0 Parent(s):

Duplicate from nvidia/canary-1b-flash

Browse files

Co-authored-by: Kunal Dhawan <kunaldhawan@users.noreply.huggingface.co>

.eval_results/open_asr_leaderboard.yaml ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ - dataset:
2
+ id: hf-audio/open-asr-leaderboard
3
+ task_id: mean_wer
4
+ value: 6.35
5
+ date: '2025-03-07'
6
+ source:
7
+ url: https://huggingface.co/hf-audio
8
+ name: open-asr-leaderboard
9
+ user: hf-audio
10
+
11
+ - dataset:
12
+ id: hf-audio/open-asr-leaderboard
13
+ task_id: rtfx
14
+ value: 1045.75
15
+ date: '2025-03-07'
16
+ source:
17
+ url: https://huggingface.co/hf-audio
18
+ name: open-asr-leaderboard
19
+ user: hf-audio
20
+
21
+ - dataset:
22
+ id: hf-audio/open-asr-leaderboard
23
+ task_id: ami_wer
24
+ value: 13.11
25
+ date: '2025-03-07'
26
+ source:
27
+ url: https://huggingface.co/hf-audio
28
+ name: open-asr-leaderboard
29
+ user: hf-audio
30
+
31
+ - dataset:
32
+ id: hf-audio/open-asr-leaderboard
33
+ task_id: earnings22_wer
34
+ value: 12.77
35
+ date: '2025-03-07'
36
+ source:
37
+ url: https://huggingface.co/hf-audio
38
+ name: open-asr-leaderboard
39
+ user: hf-audio
40
+
41
+ - dataset:
42
+ id: hf-audio/open-asr-leaderboard
43
+ task_id: gigaspeech_wer
44
+ value: 9.85
45
+ date: '2025-03-07'
46
+ source:
47
+ url: https://huggingface.co/hf-audio
48
+ name: open-asr-leaderboard
49
+ user: hf-audio
50
+
51
+ - dataset:
52
+ id: hf-audio/open-asr-leaderboard
53
+ task_id: librispeech_clean_wer
54
+ value: 1.48
55
+ date: '2025-03-07'
56
+ source:
57
+ url: https://huggingface.co/hf-audio
58
+ name: open-asr-leaderboard
59
+ user: hf-audio
60
+
61
+ - dataset:
62
+ id: hf-audio/open-asr-leaderboard
63
+ task_id: librispeech_other_wer
64
+ value: 2.87
65
+ date: '2025-03-07'
66
+ source:
67
+ url: https://huggingface.co/hf-audio
68
+ name: open-asr-leaderboard
69
+ user: hf-audio
70
+
71
+ - dataset:
72
+ id: hf-audio/open-asr-leaderboard
73
+ task_id: spgispeech_wer
74
+ value: 1.95
75
+ date: '2025-03-07'
76
+ source:
77
+ url: https://huggingface.co/hf-audio
78
+ name: open-asr-leaderboard
79
+ user: hf-audio
80
+
81
+ - dataset:
82
+ id: hf-audio/open-asr-leaderboard
83
+ task_id: tedlium_wer
84
+ value: 3.12
85
+ date: '2025-03-07'
86
+ source:
87
+ url: https://huggingface.co/hf-audio
88
+ name: open-asr-leaderboard
89
+ user: hf-audio
90
+
91
+ - dataset:
92
+ id: hf-audio/open-asr-leaderboard
93
+ task_id: voxpopuli_wer
94
+ value: 5.63
95
+ date: '2025-03-07'
96
+ source:
97
+ url: https://huggingface.co/hf-audio
98
+ name: open-asr-leaderboard
99
+ user: hf-audio
.gitattributes ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ canary-1b-flash.nemo filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,651 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ language:
4
+ - en
5
+ - de
6
+ - es
7
+ - fr
8
+ library_name: nemo
9
+ datasets:
10
+ - librispeech_asr
11
+ - fisher_corpus
12
+ - Switchboard-1
13
+ - WSJ-0
14
+ - WSJ-1
15
+ - National-Singapore-Corpus-Part-1
16
+ - National-Singapore-Corpus-Part-6
17
+ - vctk
18
+ - voxpopuli
19
+ - europarl
20
+ - multilingual_librispeech
21
+ - mozilla-foundation/common_voice_8_0
22
+ - MLCommons/peoples_speech
23
+ thumbnail: null
24
+ tags:
25
+ - automatic-speech-recognition
26
+ - automatic-speech-translation
27
+ - speech
28
+ - audio
29
+ - Transformer
30
+ - FastConformer
31
+ - Conformer
32
+ - pytorch
33
+ - NeMo
34
+ - hf-asr-leaderboard
35
+ widget:
36
+ - example_title: Librispeech sample 1
37
+ src: https://cdn-media.huggingface.co/speech_samples/sample1.flac
38
+ - example_title: Librispeech sample 2
39
+ src: https://cdn-media.huggingface.co/speech_samples/sample2.flac
40
+ model-index:
41
+ - name: canary-1b-flash
42
+ results:
43
+ - task:
44
+ name: Automatic Speech Recognition
45
+ type: automatic-speech-recognition
46
+ dataset:
47
+ name: LibriSpeech (other)
48
+ type: librispeech_asr
49
+ config: other
50
+ split: test
51
+ args:
52
+ language: en
53
+ metrics:
54
+ - name: Test WER
55
+ type: wer
56
+ value: 2.87
57
+ - task:
58
+ type: Automatic Speech Recognition
59
+ name: automatic-speech-recognition
60
+ dataset:
61
+ name: SPGI Speech
62
+ type: kensho/spgispeech
63
+ config: test
64
+ split: test
65
+ args:
66
+ language: en
67
+ metrics:
68
+ - name: Test WER
69
+ type: wer
70
+ value: 1.95
71
+ - task:
72
+ type: Automatic Speech Recognition
73
+ name: automatic-speech-recognition
74
+ dataset:
75
+ name: Mozilla Common Voice 16.1
76
+ type: mozilla-foundation/common_voice_16_1
77
+ config: en
78
+ split: test
79
+ args:
80
+ language: en
81
+ metrics:
82
+ - name: Test WER (En)
83
+ type: wer
84
+ value: 6.99
85
+ - task:
86
+ type: Automatic Speech Recognition
87
+ name: automatic-speech-recognition
88
+ dataset:
89
+ name: Mozilla Common Voice 16.1
90
+ type: mozilla-foundation/common_voice_16_1
91
+ config: de
92
+ split: test
93
+ args:
94
+ language: de
95
+ metrics:
96
+ - name: Test WER (De)
97
+ type: wer
98
+ value: 4.09
99
+ - task:
100
+ type: Automatic Speech Recognition
101
+ name: automatic-speech-recognition
102
+ dataset:
103
+ name: Mozilla Common Voice 16.1
104
+ type: mozilla-foundation/common_voice_16_1
105
+ config: es
106
+ split: test
107
+ args:
108
+ language: es
109
+ metrics:
110
+ - name: Test WER (ES)
111
+ type: wer
112
+ value: 3.62
113
+ - task:
114
+ type: Automatic Speech Recognition
115
+ name: automatic-speech-recognition
116
+ dataset:
117
+ name: Mozilla Common Voice 16.1
118
+ type: mozilla-foundation/common_voice_16_1
119
+ config: fr
120
+ split: test
121
+ args:
122
+ language: fr
123
+ metrics:
124
+ - name: Test WER (Fr)
125
+ type: wer
126
+ value: 6.15
127
+ - task:
128
+ type: Automatic Speech Translation
129
+ name: automatic-speech-translation
130
+ dataset:
131
+ name: FLEURS
132
+ type: google/fleurs
133
+ config: en_us
134
+ split: test
135
+ args:
136
+ language: en-de
137
+ metrics:
138
+ - name: Test BLEU (En->De)
139
+ type: bleu
140
+ value: 32.27
141
+ - task:
142
+ type: Automatic Speech Translation
143
+ name: automatic-speech-translation
144
+ dataset:
145
+ name: FLEURS
146
+ type: google/fleurs
147
+ config: en_us
148
+ split: test
149
+ args:
150
+ language: en-de
151
+ metrics:
152
+ - name: Test BLEU (En->Es)
153
+ type: bleu
154
+ value: 22.6
155
+ - task:
156
+ type: Automatic Speech Translation
157
+ name: automatic-speech-translation
158
+ dataset:
159
+ name: FLEURS
160
+ type: google/fleurs
161
+ config: en_us
162
+ split: test
163
+ args:
164
+ language: en-de
165
+ metrics:
166
+ - name: Test BLEU (En->Fr)
167
+ type: bleu
168
+ value: 41.22
169
+ - task:
170
+ type: Automatic Speech Translation
171
+ name: automatic-speech-translation
172
+ dataset:
173
+ name: FLEURS
174
+ type: google/fleurs
175
+ config: de_de
176
+ split: test
177
+ args:
178
+ language: de-en
179
+ metrics:
180
+ - name: Test BLEU (De->En)
181
+ type: bleu
182
+ value: 35.5
183
+ - task:
184
+ type: Automatic Speech Translation
185
+ name: automatic-speech-translation
186
+ dataset:
187
+ name: FLEURS
188
+ type: google/fleurs
189
+ config: es_419
190
+ split: test
191
+ args:
192
+ language: es-en
193
+ metrics:
194
+ - name: Test BLEU (Es->En)
195
+ type: bleu
196
+ value: 23.32
197
+ - task:
198
+ type: Automatic Speech Translation
199
+ name: automatic-speech-translation
200
+ dataset:
201
+ name: FLEURS
202
+ type: google/fleurs
203
+ config: fr_fr
204
+ split: test
205
+ args:
206
+ language: fr-en
207
+ metrics:
208
+ - name: Test BLEU (Fr->En)
209
+ type: bleu
210
+ value: 33.42
211
+ - task:
212
+ type: Automatic Speech Translation
213
+ name: automatic-speech-translation
214
+ dataset:
215
+ name: COVOST
216
+ type: covost2
217
+ config: de_de
218
+ split: test
219
+ args:
220
+ language: de-en
221
+ metrics:
222
+ - name: Test BLEU (De->En)
223
+ type: bleu
224
+ value: 39.33
225
+ - task:
226
+ type: Automatic Speech Translation
227
+ name: automatic-speech-translation
228
+ dataset:
229
+ name: COVOST
230
+ type: covost2
231
+ config: es_419
232
+ split: test
233
+ args:
234
+ language: es-en
235
+ metrics:
236
+ - name: Test BLEU (Es->En)
237
+ type: bleu
238
+ value: 41.86
239
+ - task:
240
+ type: Automatic Speech Translation
241
+ name: automatic-speech-translation
242
+ dataset:
243
+ name: COVOST
244
+ type: covost2
245
+ config: fr_fr
246
+ split: test
247
+ args:
248
+ language: fr-en
249
+ metrics:
250
+ - name: Test BLEU (Fr->En)
251
+ type: bleu
252
+ value: 41.43
253
+ metrics:
254
+ - wer
255
+ - bleu
256
+ - comet
257
+ track_downloads: true
258
+ pipeline_tag: automatic-speech-recognition
259
+ ---
260
+
261
+ # Canary 1B Flash
262
+
263
+ <style>
264
+ img {
265
+ display: inline;
266
+ }
267
+ </style>
268
+
269
+ > **🎉 NEW: Canary 1B V2 is now available!**
270
+ > 🌍 **25 European Languages** | ⏱️ **Much Improved Timestamp Prediction** | 🔄 **Enhanced ASR & AST** | 🔗 **[Try it here: nvidia/canary-1b-v2](https://huggingface.co/nvidia/canary-1b-v2)**
271
+
272
+ ## Description:
273
+ NVIDIA NeMo Canary Flash [1] is a family of multilingual multi-tasking models based on Canary architecture [2] that achieve state-of-the-art performance on multiple speech benchmarks. With 883 million parameters and an inference speed of more than 1000 RTFx (on open-asr-leaderboard datasets), canary-1b-flash supports automatic speech-to-text recognition (ASR) in four languages (English, German, French, Spanish) and translation from English to German/French/Spanish and from German/French/Spanish to English with or without punctuation and capitalization (PnC). Additionally, canary-1b-flash offers an experimental feature for word-level and segment-level timestamps in English, German, French, and Spanish.
274
+ This model is released under the permissive CC-BY-4.0 license and is available for commercial use.
275
+
276
+ ## Discover more from NVIDIA:
277
+ For documentation, deployment guides, enterprise-ready APIs, and the latest open models—including Nemotron and other cutting-edge speech, translation, and generative AI—visit the NVIDIA Developer Portal at [developer.nvidia.com](https://developer.nvidia.com/).
278
+ Join the community to access tools, support, and resources to accelerate your development with NVIDIA’s NeMo, Riva, NIM, and foundation models.<br>
279
+
280
+ ### Explore more from NVIDIA: <br>
281
+ What is [Nemotron](https://www.nvidia.com/en-us/ai-data-science/foundation-models/nemotron/)?<br>
282
+ NVIDIA Developer [Nemotron](https://developer.nvidia.com/nemotron)<br>
283
+ [NVIDIA Riva Speech](https://developer.nvidia.com/riva?sortBy=developer_learning_library%2Fsort%2Ffeatured_in.riva%3Adesc%2Ctitle%3Aasc#demos)<br>
284
+ [NeMo Documentation](https://docs.nvidia.com/nemo-framework/user-guide/latest/nemotoolkit/asr/models.html)<br>
285
+
286
+ ## Model Architecture:
287
+ Canary is an encoder-decoder model with FastConformer [3] Encoder and Transformer Decoder [4]. With audio features extracted from the encoder, task tokens such as \<target language\>, \<task\>, \<toggle timestamps\> and \<toggle PnC\> are fed into the Transformer Decoder to trigger the text generation process. Canary uses a concatenated tokenizer [5] from individual SentencePiece [6] tokenizers of each language, which makes it easy to scale up to more languages. The canary-1b-flash model has 32 encoder layers and 4 decoder layers, leading to a total of 883M parameters. For more details about the architecture, please refer to [1].
288
+
289
+ ## NVIDIA NeMo
290
+
291
+ To train, fine-tune or transcribe with canary-1b-flash, you will need to install [NVIDIA NeMo](https://github.com/NVIDIA/NeMo).
292
+
293
+ ## How to Use this Model
294
+
295
+ The model is available for use in the NeMo Framework [7], and can be used as a pre-trained checkpoint for inference or for fine-tuning on another dataset.
296
+
297
+ Please refer to [our tutorial](https://github.com/NVIDIA/NeMo/blob/main/tutorials/asr/Canary_Multitask_Speech_Model.ipynb) for more details.
298
+
299
+ A few inference examples are listed below:
300
+
301
+ ### Loading the Model
302
+
303
+ ```python
304
+ from nemo.collections.asr.models import EncDecMultiTaskModel
305
+ # load model
306
+ canary_model = EncDecMultiTaskModel.from_pretrained('nvidia/canary-1b-flash')
307
+ # update decode params
308
+ decode_cfg = canary_model.cfg.decoding
309
+ decode_cfg.beam.beam_size = 1
310
+ canary_model.change_decoding_strategy(decode_cfg)
311
+ ```
312
+
313
+ ## Input:
314
+ **Input Type(s):** Audio <br>
315
+ **Input Format(s):** .wav or .flac files<br>
316
+ **Input Parameters(s):** 1D <br>
317
+ **Other Properties Related to Input:** 16000 Hz Mono-channel Audio, Pre-Processing Not Needed <br>
318
+
319
+ Input to canary-1b-flash can be either a list of paths to audio files or a jsonl manifest file.
320
+
321
+ If the input is a list of paths, canary-1b-flash assumes that the audio is English and transcribes it. I.e., canary-1b-flash default behavior is English ASR.
322
+ ```python
323
+ output = canary_model.transcribe(
324
+ ['path1.wav', 'path2.wav'],
325
+ batch_size=16, # batch size to run the inference with
326
+ pnc='yes', # generate output with Punctuation and Capitalization
327
+ )
328
+
329
+ predicted_text_1 = output[0].text
330
+
331
+ ```
332
+
333
+ canary-1b-flash can also generate word and segment level timestamps
334
+ ```python
335
+ output = canary_model.transcribe(
336
+ ['filepath.wav'],
337
+ timestamps='yes', # generate output with timestamps
338
+ )
339
+
340
+ predicted_text = output[0].text
341
+ word_level_timestamps = output[0].timestamp['word']
342
+ segment_level_timestamps = output[0].timestamp['segment']
343
+
344
+ ```
345
+ For audio files longer than 10 seconds, we recommend using longform inference script (explained in next section) with `chunk_len_in_secs=10.0` to generate timestamps.
346
+
347
+
348
+ To use canary-1b-flash for transcribing other supported languages or perform Speech-to-Text translation or provide word-level timestamps, specify the input as jsonl manifest file, where each line in the file is a dictionary containing the following fields:
349
+
350
+ ```yaml
351
+ # Example of a line in input_manifest.json
352
+ {
353
+ "audio_filepath": "/path/to/audio.wav", # path to the audio file
354
+ "source_lang": "en", # language of the audio input, set `source_lang`==`target_lang` for ASR, choices=['en','de','es','fr']
355
+ "target_lang": "en", # language of the text output, choices=['en','de','es','fr']
356
+ "pnc": "yes", # whether to have PnC output, choices=['yes', 'no']
357
+ "timestamp": "yes", # whether to output word-level timestamps, choices=['yes', 'no']
358
+ }
359
+ ```
360
+
361
+ and then use:
362
+ ```python
363
+ output = canary_model.transcribe(
364
+ "<path to input manifest file>",
365
+ batch_size=16, # batch size to run the inference with
366
+ )
367
+ ```
368
+
369
+ ### Longform inference with Canary-1B-flash:
370
+ Canary models are designed to handle input audio smaller than 40 seconds. In order to handle longer audios, NeMo includes [speech_to_text_aed_chunked_infer.py](https://github.com/NVIDIA/NeMo/blob/main/examples/asr/asr_chunked_inference/aed/speech_to_text_aed_chunked_infer.py) script that handles chunking, performs inference on the chunked files, and stitches the transcripts.
371
+
372
+ The script will perform inference on all `.wav` files in `audio_dir`. Alternatively you can also pass a path to a manifest file as shown above. The decoded output will be saved at `output_json_path`.
373
+
374
+ ```
375
+ python scripts/speech_to_text_aed_chunked_infer.py \
376
+ pretrained_name="nvidia/canary-1b-flash" \
377
+ audio_dir=$audio_dir \
378
+ output_filename=$output_json_path \
379
+ chunk_len_in_secs=40.0 \
380
+ batch_size=1 \
381
+ decoding.beam.beam_size=1 \
382
+ timestamps=False
383
+ ```
384
+
385
+ **Note** that for longform inference with timestamps, it is recommended to use `chunk_len_in_secs` of 10 seconds.
386
+
387
+
388
+ ## Output:
389
+ **Output Type(s):** Text <br>
390
+ **Output Format:** Text output as a string (w/ timestamps) depending on the task chosen for decoding <br>
391
+ **Output Parameters:** 1-Dimensional text string <br>
392
+ **Other Properties Related to Output:** May Need Inverse Text Normalization; Does Not Handle Special Characters <br>
393
+
394
+
395
+ ## Software Integration:
396
+ **Runtime Engine(s):**
397
+ * NeMo - main <br>
398
+
399
+ **Supported Hardware Microarchitecture Compatibility:** <br>
400
+ * [NVIDIA Ampere] <br>
401
+ * [NVIDIA Blackwell] <br>
402
+ * [NVIDIA Jetson] <br>
403
+ * [NVIDIA Hopper] <br>
404
+ * [NVIDIA Lovelace] <br>
405
+ * [NVIDIA Pascal] <br>
406
+ * [NVIDIA Turing] <br>
407
+ * [NVIDIA Volta] <br>
408
+
409
+ **[Preferred/Supported] Operating System(s):** <br>
410
+ * [Linux] <br>
411
+ * [Linux 4 Tegra] <br>
412
+ * [Windows] <br>
413
+
414
+ ## Model Version(s):
415
+ canary-1b-flash <br>
416
+
417
+
418
+ # Training and Evaluation Datasets:
419
+
420
+ ## Training Dataset:
421
+
422
+ The canary-1b-flash model is trained on a total of 85K hrs of speech data. It consists of 31K hrs of public data, 20K hrs collected by [Suno](https://suno.ai/), and 34K hrs of in-house data.
423
+ The datasets below include conversations, videos from the web and audiobook recordings.
424
+
425
+ **Data Collection Method:**
426
+ * Human <br>
427
+
428
+ **Labeling Method:**
429
+ * Hybrid: Human, Automated <br>
430
+
431
+ The constituents of public data are as follows.
432
+
433
+ #### English (25.5k hours)
434
+ - Librispeech 960 hours
435
+ - Fisher Corpus
436
+ - Switchboard-1 Dataset
437
+ - WSJ-0 and WSJ-1
438
+ - National Speech Corpus (Part 1, Part 6)
439
+ - VCTK
440
+ - VoxPopuli (EN)
441
+ - Europarl-ASR (EN)
442
+ - Multilingual Librispeech (MLS EN) - 2,000 hour subset
443
+ - Mozilla Common Voice (v7.0)
444
+ - People's Speech - 12,000 hour subset
445
+ - Mozilla Common Voice (v11.0) - 1,474 hour subset
446
+
447
+ #### German (2.5k hours)
448
+ - Mozilla Common Voice (v12.0) - 800 hour subset
449
+ - Multilingual Librispeech (MLS DE) - 1,500 hour subset
450
+ - VoxPopuli (DE) - 200 hr subset
451
+
452
+ #### Spanish (1.4k hours)
453
+ - Mozilla Common Voice (v12.0) - 395 hour subset
454
+ - Multilingual Librispeech (MLS ES) - 780 hour subset
455
+ - VoxPopuli (ES) - 108 hour subset
456
+ - Fisher - 141 hour subset
457
+
458
+ #### French (1.8k hours)
459
+ - Mozilla Common Voice (v12.0) - 708 hour subset
460
+ - Multilingual Librispeech (MLS FR) - 926 hour subset
461
+ - VoxPopuli (FR) - 165 hour subset
462
+
463
+
464
+ ## Evaluation Dataset:
465
+
466
+ **Data Collection Method:** <br>
467
+ * Human <br>
468
+
469
+ **Labeling Method:** <br>
470
+ * Human <br>
471
+
472
+ Automatic Speech Recognition:
473
+ * [HuggingFace OpenASR Leaderboard evaluation sets](https://huggingface.co/spaces/hf-audio/open_asr_leaderboard)
474
+ * [MLS](https://huggingface.co/datasets/facebook/multilingual_librispeech)
475
+ * [MCV] (https://commonvoice.mozilla.org/en/datasets)
476
+
477
+ Automatic Speech Translation:
478
+ * [FLEURS](https://huggingface.co/datasets/google/fleurs)
479
+ * [COVOST-v2](https://github.com/facebookresearch/covost)
480
+ * [mExpresso](https://huggingface.co/facebook/seamless-expressive#mexpresso-multilingual-expresso)
481
+
482
+ Timestamp Prediction:
483
+ * [Librispeech](https://www.openslr.org/12)
484
+
485
+ Hallucination Robustness:
486
+ * [MUSAN](https://www.openslr.org/17/) 48 hrs eval set
487
+
488
+ Noise Robustness:
489
+ * [Librispeech](https://www.openslr.org/12)
490
+
491
+ Model Fairness:
492
+ * [Casual Conversations Dataset](https://arxiv.org/abs/2104.02821)
493
+
494
+ ## Training
495
+
496
+ Canary-1B-Flash is trained using the NVIDIA NeMo Framework [7] for a total of 200K steps with 2D bucketing [1] and optimal batch sizes set using OOMptimizer [8].The model is trained on 128 NVIDIA A100 80GB GPUs.
497
+ The model can be trained using this [example script](https://github.com/NVIDIA/NeMo/blob/main/examples/asr/speech_multitask/speech_to_text_aed.py) and [base config](https://github.com/NVIDIA/NeMo/blob/main/examples/asr/conf/speech_multitask/fast-conformer_aed.yaml).
498
+
499
+ The tokenizers for these models were built using the text transcripts of the train set with this [script](https://github.com/NVIDIA/NeMo/blob/main/scripts/tokenizers/process_asr_text_tokenizer.py).
500
+
501
+ ## Inference:
502
+ **Engine:** NVIDIA NeMo <br>
503
+ **Test Hardware :** <br>
504
+ * A6000 <br>
505
+ * A100 <br>
506
+ * V100 <br>
507
+
508
+ ## Performance
509
+
510
+ For ASR and AST experiments, predictions were generated using greedy decoding. Note that utterances shorter than 1 second are symmetrically zero-padded upto 1 second during evaluation.
511
+
512
+ ### English ASR Performance (w/o PnC)
513
+
514
+ The ASR performance is measured with word error rate (WER), and we process the groundtruth and predicted text with [whisper-normalizer](https://pypi.org/project/whisper-normalizer/).
515
+
516
+ WER on [HuggingFace OpenASR leaderboard](https://huggingface.co/spaces/hf-audio/open_asr_leaderboard):
517
+
518
+ | **Version** | **Model** | **RTFx** | **AMI** | **GigaSpeech** | **LS Clean** | **LS Other** | **Earnings22** | **SPGISpech** | **Tedlium** | **Voxpopuli** |
519
+ |:---------:|:-----------:|:------:|:------:|:------:|:------:|:------:|:------:|:------:|:------:|:------:|
520
+ | nemo-main | canary-1b-flash | 1045.75 | 13.11 | 9.85 | 1.48 | 2.87 | 12.79 | 1.95 | 3.12 | 5.63 |
521
+
522
+ #### Inference speed on different systems
523
+ We profiled inference speed on the OpenASR benchmark (batch_size=128) using the [real-time factor](https://github.com/NVIDIA/DeepLearningExamples/blob/master/Kaldi/SpeechRecognition/README.md#metrics) (RTFx) to quantify throughput.
524
+
525
+ | **Version** | **Model** | **System** | **RTFx** |
526
+ |:-----------:|:-------------:|:------------:|:----------:|
527
+ | nemo-main | canary-1b-flash | NVIDIA A100 | 1045.75 |
528
+ | nemo-main | canary-1b-flash | NVIDIA H100 | 1669.07 |
529
+
530
+
531
+
532
+ ### Multilingual ASR Performance
533
+
534
+ WER on [MLS](https://huggingface.co/datasets/facebook/multilingual_librispeech) test set:
535
+
536
+ | **Version** | **Model** | **De** | **Es** | **Fr** |
537
+ |:---------:|:-----------:|:------:|:------:|:------:|
538
+ | nemo-main | canary-1b-flash | 4.36 | 2.69 | 4.47 |
539
+
540
+ WER on [MCV-16.1](https://commonvoice.mozilla.org/en/datasets) test set:
541
+ | **Version** | **Model** | **En** | **De** | **Es** | **Fr** |
542
+ |:---------:|:-----------:|:------:|:------:|:------:|:------:|
543
+ | nemo-main | canary-1b-flash | 6.99 | 4.09 | 3.62 | 6.15 |
544
+
545
+
546
+ More details on evaluation can be found at [HuggingFace ASR Leaderboard](https://huggingface.co/spaces/hf-audio/open_asr_leaderboard)
547
+
548
+ ### AST Performance
549
+
550
+ We evaluate AST performance with [BLEU score](https://lightning.ai/docs/torchmetrics/stable/text/sacre_bleu_score.html) and [COMET score](https://aclanthology.org/2020.emnlp-main.213/), and use native annotations with punctuation and capitalization in the datasets.
551
+
552
+ [FLEURS](https://huggingface.co/datasets/google/fleurs) test set:
553
+
554
+ BLEU score:
555
+ | **Version** | **Model** | **En->De** | **En->Es** | **En->Fr** | **De->En** | **Es->En** | **Fr->En** |
556
+ |:-----------:|:---------:|:----------:|:----------:|:----------:|:----------:|:----------:|:----------:|
557
+ | nemo-main | canary-1b-flash | 32.27 | 22.6 | 41.22 | 35.5 | 23.32 | 33.42 |
558
+
559
+ COMET score:
560
+ | **Version** | **Model** | **En->De** | **En->Es** | **En->Fr** | **De->En** | **Es->En** | **Fr->En** |
561
+ |:-----------:|:---------:|:----------:|:----------:|:----------:|:----------:|:----------:|:----------:|
562
+ | nemo-main | canary-1b-flash | 0.8114 | 0.8118 | 0.8165 | 0.8546 | 0.8228 | 0.8475 |
563
+
564
+ [COVOST-v2](https://github.com/facebookresearch/covost) test set:
565
+
566
+ BLEU score:
567
+ | **Version** | **Model** | **De->En** | **Es->En** | **Fr->En** |
568
+ |:-----------:|:---------:|:----------:|:----------:|:----------:|
569
+ | nemo-main | canary-1b-flash | 39.33 | 41.86 | 41.43 |
570
+
571
+ COMET score:
572
+ | **Version** | **Model** | **De->En** | **Es->En** | **Fr->En** |
573
+ |:-----------:|:---------:|:----------:|:----------:|:----------:|
574
+ | nemo-main | canary-1b-flash | 0.8553 | 0.8585 | 0.8511 |
575
+
576
+ [mExpresso](https://huggingface.co/facebook/seamless-expressive#mexpresso-multilingual-expresso) test set:
577
+
578
+ BLEU score:
579
+ | **Version** | **Model** | **En->De** | **En->Es** | **En->Fr** |
580
+ |:-----------:|:---------:|:----------:|:----------:|:----------:|
581
+ | nemo-main | canary-1b-flash | 22.91 | 35.69 | 27.85 |
582
+
583
+ COMET score:
584
+ | **Version** | **Model** | **En->De** | **En->Es** | **En->Fr** |
585
+ |:-----------:|:---------:|:----------:|:----------:|:----------:|
586
+ | nemo-main | canary-1b-flash | 0.7889 | 0.8211 | 0.7910 |
587
+
588
+ ### Timestamp Prediction
589
+ F1-score on [Librispeech Test sets](https://www.openslr.org/12) at collar value of 200ms
590
+ | **Version** | **Model** | **test-clean** | **test-other** |
591
+ |:-----------:|:---------:|:----------:|:----------:|
592
+ | nemo-main | canary-1b-flash | 95.5 | 93.5 |
593
+
594
+
595
+ ### Hallucination Robustness
596
+ Number of characters per minute on [MUSAN](https://www.openslr.org/17) 48 hrs eval set
597
+ | **Version** | **Model** | **# of character per minute** |
598
+ |:-----------:|:---------:|:----------:|
599
+ | nemo-main | canary-1b-flash | 60.92 |
600
+
601
+ ### Noise Robustness
602
+ WER on [Librispeech Test Clean](https://www.openslr.org/12) at different SNR (signal to noise ratio) levels of additive white noise
603
+
604
+ | **Version** | **Model** | **SNR 10** | **SNR 5** | **SNR 0** | **SNR -5** |
605
+ |:-----------:|:---------:|:----------:|:----------:|:----------:|:----------:|
606
+ | nemo-main | canary-1b-flash | 2.34 | 3.69 | 8.84 | 29.71 |
607
+
608
+ ## Model Fairness Evaluation
609
+
610
+ As outlined in the paper "Towards Measuring Fairness in AI: the Casual Conversations Dataset" [9], we assessed the canary-1b-flash model for fairness. The model was evaluated on the CausalConversations-v1 dataset, and the results are reported as follows:
611
+
612
+ ### Gender Bias:
613
+
614
+ | Gender | Male | Female | N/A | Other |
615
+ | :--- | :--- | :--- | :--- | :--- |
616
+ | Num utterances | 19325 | 24532 | 926 | 33 |
617
+ | % WER | 14.66 | 12.44 | 17.17 | 27.56 |
618
+
619
+ ### Age Bias:
620
+
621
+ | Age Group | (18-30) | (31-45) | (46-85) | (1-100) |
622
+ | :--- | :--- | :--- | :--- | :--- |
623
+ | Num utterances | 15956 | 14585 | 13349 | 43890 |
624
+ | % WER | 13.18 | 13.45 | 13.64 | 13.41 |
625
+
626
+ (Error rates for fairness evaluation are determined by normalizing both the reference and predicted text, similar to the methods used in the evaluations found at https://github.com/huggingface/open_asr_leaderboard.)
627
+
628
+
629
+ ## References:
630
+ [1] [Training and Inference Efficiency of Encoder-Decoder Speech Models](https://arxiv.org/abs/2503.05931)
631
+
632
+ [2] [Less is More: Accurate Speech Recognition & Translation without Web-Scale Data](https://www.isca-archive.org/interspeech_2024/puvvada24_interspeech.pdf)
633
+
634
+ [3] [Fast Conformer with Linearly Scalable Attention for Efficient Speech Recognition](https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=10389701)
635
+
636
+ [4] [Attention is All You Need](https://arxiv.org/abs/1706.03762)
637
+
638
+ [5] [Unified Model for Code-Switching Speech Recognition and Language Identification Based on Concatenated Tokenizer](https://aclanthology.org/2023.calcs-1.7.pdf)
639
+
640
+ [6] [Google Sentencepiece Tokenizer](https://github.com/google/sentencepiece)
641
+
642
+ [7] [NVIDIA NeMo Framework](https://github.com/NVIDIA/NeMo)
643
+
644
+ [8] [EMMeTT: Efficient Multimodal Machine Translation Training](https://arxiv.org/abs/2409.13523)
645
+
646
+ [9] [Towards Measuring Fairness in AI: the Casual Conversations Dataset](https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=9634168)
647
+
648
+
649
+ ## Ethical Considerations:
650
+ NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse.
651
+ Please report security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).
canary-1b-flash.nemo ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3887cce1afdd425429cfc5109575a8f2cffeb07c02c503a9faff7612bd74e324
3
+ size 3540715520
config.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "activation_dropout": 0.1,
3
+ "activation_function": "silu",
4
+ "architectures": [
5
+ "FastConformerModel"
6
+ ],
7
+ "attention_dropout": 0.1,
8
+ "bos_token_id": 1,
9
+ "conv_kernel_size": 9,
10
+ "d_model": 1024,
11
+ "dropout": 0.1,
12
+ "dropout_emb": 0.0,
13
+ "encoder_attention_heads": 8,
14
+ "encoder_ffn_dim": 4096,
15
+ "encoder_layerdrop": 0.1,
16
+ "encoder_layers": 32,
17
+ "eos_token_id": 2,
18
+ "initializer_range": 0.02,
19
+ "model_type": "fastconformer",
20
+ "nemo_decoder_type": "none",
21
+ "nemo_encoder_type": "nemo.collections.asr.modules.ConformerEncoder",
22
+ "nemo_model_name": "nvidia/canary-1b-flash",
23
+ "nemo_model_type": "canary",
24
+ "num_mel_bins": 128,
25
+ "pad_token_id": 0,
26
+ "subsampling_conv_channels": 256,
27
+ "subsampling_factor": 8,
28
+ "torch_dtype": "float32",
29
+ "transformers_version": "4.53.0.dev0",
30
+ "use_bias": true,
31
+ "vocab_size": 1024,
32
+ "xscaling": false
33
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:de4623bb78419f40a12258245175ea8da2a054f8e4d742ab1ee09bdd15912a04
3
+ size 3244348800
preprocessor_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_filterbanks": null,
3
+ "f_max": 8000,
4
+ "f_min": 0,
5
+ "feature_extractor_type": "FastConformerFeatureExtractor",
6
+ "feature_size": 128,
7
+ "hop_length": 160,
8
+ "mag_power": 2.0,
9
+ "mel_norm": "slaney",
10
+ "mel_scale": "htk",
11
+ "n_fft": 512,
12
+ "n_mels": 128,
13
+ "normalize": "per_feature",
14
+ "padding_side": "right",
15
+ "padding_value": 0.0,
16
+ "preemph": 0.97,
17
+ "return_attention_mask": true,
18
+ "sampling_rate": 16000,
19
+ "win_length": 400,
20
+ "window_size": 0.025,
21
+ "window_stride": 0.01
22
+ }