Purfview commited on
Commit
d5d2dfb
·
verified ·
1 Parent(s): 63662a7

Upload 6 files

Browse files
Files changed (6) hide show
  1. README.md +79 -0
  2. config.json +280 -0
  3. model.bin +3 -0
  4. preprocessor_config.json +14 -0
  5. tokenizer.json +0 -0
  6. vocabulary.json +0 -0
README.md ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ tags:
5
+ - audio
6
+ - automatic-speech-recognition
7
+ license: mit
8
+ library_name: ctranslate2
9
+ ---
10
+
11
+ # Distil-Whisper: Distil-Large-v3.5 for CTranslate2
12
+
13
+ This repository contains the model weights for [distil-large-v3.5](https://huggingface.co/distil-whisper/distil-large-v3.5)
14
+ converted to [CTranslate2](https://github.com/OpenNMT/CTranslate2) format. CTranslate2 is a fast inference engine for
15
+ Transformer models and is the supported backend for the [Faster-Whisper](https://github.com/systran/faster-whisper) package.
16
+
17
+ ## Usage
18
+
19
+ To use the model in Faster-Whisper, first install the PyPi package according to the [official instructions](https://github.com/SYSTRAN/faster-whisper#installation).
20
+
21
+ For this example, we'll also install 🤗 Datasets to load a toy audio dataset from the Hugging Face Hub:
22
+
23
+ ```bash
24
+ pip install --upgrade pip
25
+ pip install --upgrade git+https://github.com/SYSTRAN/faster-whisper datasets[audio]
26
+ ```
27
+
28
+ The following code snippet loads the distil-large-v3 model and runs inference on an example file from the LibriSpeech ASR
29
+ dataset:
30
+
31
+ ```python
32
+ import torch
33
+ from faster_whisper import WhisperModel
34
+ from datasets import load_dataset
35
+
36
+ # define our torch configuration
37
+ device = "cuda" if torch.cuda.is_available() else "cpu"
38
+ compute_type = "float16" if torch.cuda.is_available() else "float32"
39
+
40
+ # load model on GPU if available, else cpu
41
+ model = WhisperModel("distil-whisper/distil-large-v3.5-ct2", device=device, compute_type=compute_type)
42
+
43
+ # load toy dataset for example
44
+ dataset = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
45
+ sample = dataset[1]["audio"]["path"]
46
+
47
+ segments, info = model.transcribe(sample, beam_size=5, language="en")
48
+
49
+ for segment in segments:
50
+ print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))
51
+ ```
52
+
53
+ To transcribe a local audio file, simply pass the path to the audio file as the `audio` argument to transcribe:
54
+
55
+ ```python
56
+ segments, info = model.transcribe("audio.mp3", beam_size=5, language="en")
57
+ ```
58
+
59
+ ## Model Details
60
+
61
+ For more information about the Distil-Large-v3.5 model, refer to the original [model card](https://huggingface.co/distil-whisper/distil-large-v3.5).
62
+
63
+ ## License
64
+
65
+ Distil-Whisper inherits the [MIT license](https://github.com/huggingface/distil-whisper/blob/main/LICENSE) from OpenAI's Whisper model.
66
+
67
+ ## Citation
68
+
69
+ If you use this model, please consider citing the [Distil-Whisper paper](https://arxiv.org/abs/2311.00430):
70
+ ```
71
+ @misc{gandhi2023distilwhisper,
72
+ title={Distil-Whisper: Robust Knowledge Distillation via Large-Scale Pseudo Labelling},
73
+ author={Sanchit Gandhi and Patrick von Platen and Alexander M. Rush},
74
+ year={2023},
75
+ eprint={2311.00430},
76
+ archivePrefix={arXiv},
77
+ primaryClass={cs.CL}
78
+ }
79
+ ```
config.json ADDED
@@ -0,0 +1,280 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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,
98
+ 50272,
99
+ 50273,
100
+ 50274,
101
+ 50275,
102
+ 50276,
103
+ 50277,
104
+ 50278,
105
+ 50279,
106
+ 50280,
107
+ 50281,
108
+ 50282,
109
+ 50283,
110
+ 50284,
111
+ 50285,
112
+ 50286,
113
+ 50287,
114
+ 50288,
115
+ 50289,
116
+ 50290,
117
+ 50291,
118
+ 50292,
119
+ 50293,
120
+ 50294,
121
+ 50295,
122
+ 50296,
123
+ 50297,
124
+ 50298,
125
+ 50299,
126
+ 50300,
127
+ 50301,
128
+ 50302,
129
+ 50303,
130
+ 50304,
131
+ 50305,
132
+ 50306,
133
+ 50307,
134
+ 50308,
135
+ 50309,
136
+ 50310,
137
+ 50311,
138
+ 50312,
139
+ 50313,
140
+ 50314,
141
+ 50315,
142
+ 50316,
143
+ 50317,
144
+ 50318,
145
+ 50319,
146
+ 50320,
147
+ 50321,
148
+ 50322,
149
+ 50323,
150
+ 50324,
151
+ 50325,
152
+ 50326,
153
+ 50327,
154
+ 50328,
155
+ 50329,
156
+ 50330,
157
+ 50331,
158
+ 50332,
159
+ 50333,
160
+ 50334,
161
+ 50335,
162
+ 50336,
163
+ 50337,
164
+ 50338,
165
+ 50339,
166
+ 50340,
167
+ 50341,
168
+ 50342,
169
+ 50343,
170
+ 50344,
171
+ 50345,
172
+ 50346,
173
+ 50347,
174
+ 50348,
175
+ 50349,
176
+ 50350,
177
+ 50351,
178
+ 50352,
179
+ 50353,
180
+ 50354,
181
+ 50355,
182
+ 50356,
183
+ 50357,
184
+ 50358
185
+ ],
186
+ "suppress_ids": [
187
+ 1,
188
+ 2,
189
+ 7,
190
+ 8,
191
+ 9,
192
+ 10,
193
+ 14,
194
+ 25,
195
+ 26,
196
+ 27,
197
+ 28,
198
+ 29,
199
+ 31,
200
+ 58,
201
+ 59,
202
+ 60,
203
+ 61,
204
+ 62,
205
+ 63,
206
+ 90,
207
+ 91,
208
+ 92,
209
+ 93,
210
+ 359,
211
+ 503,
212
+ 522,
213
+ 542,
214
+ 873,
215
+ 893,
216
+ 902,
217
+ 918,
218
+ 922,
219
+ 931,
220
+ 1350,
221
+ 1853,
222
+ 1982,
223
+ 2460,
224
+ 2627,
225
+ 3246,
226
+ 3253,
227
+ 3268,
228
+ 3536,
229
+ 3846,
230
+ 3961,
231
+ 4183,
232
+ 4667,
233
+ 6585,
234
+ 6647,
235
+ 7273,
236
+ 9061,
237
+ 9383,
238
+ 10428,
239
+ 10929,
240
+ 11938,
241
+ 12033,
242
+ 12331,
243
+ 12562,
244
+ 13793,
245
+ 14157,
246
+ 14635,
247
+ 15265,
248
+ 15618,
249
+ 16553,
250
+ 16604,
251
+ 18362,
252
+ 18956,
253
+ 20075,
254
+ 21675,
255
+ 22520,
256
+ 26130,
257
+ 26161,
258
+ 26435,
259
+ 28279,
260
+ 29464,
261
+ 31650,
262
+ 32302,
263
+ 32470,
264
+ 36865,
265
+ 42863,
266
+ 47425,
267
+ 49870,
268
+ 50254,
269
+ 50258,
270
+ 50359,
271
+ 50360,
272
+ 50361,
273
+ 50362,
274
+ 50363
275
+ ],
276
+ "suppress_ids_begin": [
277
+ 220,
278
+ 50257
279
+ ]
280
+ }
model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c58b88b8585ffcd2135fddaaf421ce72cb223b32edea70d156aed1dea319a119
3
+ size 1512927867
preprocessor_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "chunk_length": 30,
3
+ "feature_extractor_type": "WhisperFeatureExtractor",
4
+ "feature_size": 128,
5
+ "hop_length": 160,
6
+ "n_fft": 400,
7
+ "n_samples": 480000,
8
+ "nb_max_frames": 3000,
9
+ "padding_side": "right",
10
+ "padding_value": 0.0,
11
+ "processor_class": "WhisperProcessor",
12
+ "return_attention_mask": false,
13
+ "sampling_rate": 16000
14
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
vocabulary.json ADDED
The diff for this file is too large to render. See raw diff