Spaces:
Running
Running
Add distill link (#5)
Browse files- Update index.html (0020d89df65f203eef45536b712135c8fdc8f0dc)
Co-authored-by: Radamés Ajna <radames@users.noreply.huggingface.co>
- index.html +49 -35
index.html
CHANGED
@@ -26,32 +26,54 @@
|
|
26 |
|
27 |
// models base url
|
28 |
const MODELS = {
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
const whisperWorker = new Worker("./whisperWorker.js", {
|
56 |
type: "module",
|
57 |
});
|
@@ -150,7 +172,7 @@
|
|
150 |
if (audioURL === null) {
|
151 |
return;
|
152 |
}
|
153 |
-
const modelID =
|
154 |
const model = MODELS[modelID];
|
155 |
const modelURL = model.base_url + model.model;
|
156 |
const tokenizerURL = model.base_url + model.tokenizer;
|
@@ -222,14 +244,6 @@
|
|
222 |
<select
|
223 |
id="model"
|
224 |
class="border-2 border-gray-500 rounded-md font-light">
|
225 |
-
<option value="tiny_multilingual" selected>tiny.en (151 MB)</option>
|
226 |
-
<option value="tiny_en" selected>tiny.en (151 MB)</option>
|
227 |
-
<option value="tiny_quantized_multilingual_q80">
|
228 |
-
tiny quantized q80 (41.5 MB)
|
229 |
-
</option>
|
230 |
-
<option value="tiny_en_quantized_q80">
|
231 |
-
tiny.en quantized q80 (41.8 MB)
|
232 |
-
</option>
|
233 |
</select>
|
234 |
</div>
|
235 |
<!-- drag and drop area -->
|
|
|
26 |
|
27 |
// models base url
|
28 |
const MODELS = {
|
29 |
+
tiny_multilingual: {
|
30 |
+
base_url: "https://huggingface.co/openai/whisper-tiny/resolve/main/",
|
31 |
+
model: "model.safetensors",
|
32 |
+
tokenizer: "tokenizer.json",
|
33 |
+
config: "config.json",
|
34 |
+
size: "151 MB",
|
35 |
+
},
|
36 |
+
tiny_en: {
|
37 |
+
base_url:
|
38 |
+
"https://huggingface.co/openai/whisper-tiny.en/resolve/main/",
|
39 |
+
model: "model.safetensors",
|
40 |
+
tokenizer: "tokenizer.json",
|
41 |
+
config: "config.json",
|
42 |
+
size: "151 MB",
|
43 |
+
},
|
44 |
+
tiny_quantized_multilingual_q80: {
|
45 |
+
base_url: "https://huggingface.co/lmz/candle-whisper/resolve/main/",
|
46 |
+
model: "model-tiny-q80.gguf",
|
47 |
+
tokenizer: "tokenizer-tiny.json",
|
48 |
+
config: "config-tiny.json",
|
49 |
+
size: "41.5 MB",
|
50 |
+
},
|
51 |
+
tiny_en_quantized_q80: {
|
52 |
+
base_url: "https://huggingface.co/lmz/candle-whisper/resolve/main/",
|
53 |
+
model: "model-tiny-q80.gguf",
|
54 |
+
tokenizer: "tokenizer-tiny-en.json",
|
55 |
+
config: "config-tiny-en.json",
|
56 |
+
size: "41.8 MB",
|
57 |
+
},
|
58 |
+
distil_medium_en: {
|
59 |
+
base_url:
|
60 |
+
"https://huggingface.co/distil-whisper/distil-medium.en/resolve/main/",
|
61 |
+
model: "model.safetensors",
|
62 |
+
tokenizer: "tokenizer.json",
|
63 |
+
config: "config.json",
|
64 |
+
size: "789 MB",
|
65 |
+
},
|
66 |
+
};
|
67 |
+
|
68 |
+
const modelEl = document.querySelector("#model");
|
69 |
+
|
70 |
+
Object.keys(MODELS).forEach((modelID) => {
|
71 |
+
const model = MODELS[modelID];
|
72 |
+
const option = document.createElement("option");
|
73 |
+
option.value = modelID;
|
74 |
+
option.textContent = `${modelID} (${model.size})`;
|
75 |
+
modelEl.appendChild(option);
|
76 |
+
});
|
77 |
const whisperWorker = new Worker("./whisperWorker.js", {
|
78 |
type: "module",
|
79 |
});
|
|
|
172 |
if (audioURL === null) {
|
173 |
return;
|
174 |
}
|
175 |
+
const modelID = modelEl.value;
|
176 |
const model = MODELS[modelID];
|
177 |
const modelURL = model.base_url + model.model;
|
178 |
const tokenizerURL = model.base_url + model.tokenizer;
|
|
|
244 |
<select
|
245 |
id="model"
|
246 |
class="border-2 border-gray-500 rounded-md font-light">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
</select>
|
248 |
</div>
|
249 |
<!-- drag and drop area -->
|