Update to Transformers.js v3 (#27)
Browse files- Update to Transformers.js v3 (ddfc002b382314c417461a8e6d97f8916a556552)
- Update config.json (2d6a737dbda224c6342cbc31ad44c4878935aab3)
- Update generation_config.json (2d3c1a51337b6b78d084a4235f78692979a8c1be)
- Update generation_config.json (d5aec4652fe3121fe09f6eb7d6718b4d2b819cdf)
- README.md +4 -4
- config.json +5 -0
README.md
CHANGED
|
@@ -310,12 +310,12 @@ make -j && ./main -m models/ggml-large-32-2.en.bin -f samples/jfk.wav
|
|
| 310 |
### Transformers.js
|
| 311 |
|
| 312 |
```js
|
| 313 |
-
import { pipeline } from '@
|
| 314 |
|
| 315 |
-
|
| 316 |
|
| 317 |
-
|
| 318 |
-
|
| 319 |
// { text: " And so, my fellow Americans, ask not what your country can do for you. Ask what you can do for your country." }
|
| 320 |
```
|
| 321 |
|
|
|
|
| 310 |
### Transformers.js
|
| 311 |
|
| 312 |
```js
|
| 313 |
+
import { pipeline } from '@huggingface/transformers';
|
| 314 |
|
| 315 |
+
const transcriber = await pipeline('automatic-speech-recognition', 'distil-whisper/distil-large-v2');
|
| 316 |
|
| 317 |
+
const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';
|
| 318 |
+
const output = await transcriber(url);
|
| 319 |
// { text: " And so, my fellow Americans, ask not what your country can do for you. Ask what you can do for your country." }
|
| 320 |
```
|
| 321 |
|
config.json
CHANGED
|
@@ -146,6 +146,11 @@
|
|
| 146 |
],
|
| 147 |
"torch_dtype": "float32",
|
| 148 |
"transformers_version": "4.35.0.dev0",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
"use_cache": true,
|
| 150 |
"use_weighted_layer_sum": false,
|
| 151 |
"vocab_size": 51865
|
|
|
|
| 146 |
],
|
| 147 |
"torch_dtype": "float32",
|
| 148 |
"transformers_version": "4.35.0.dev0",
|
| 149 |
+
"transformers.js_config": {
|
| 150 |
+
"use_external_data_format": {
|
| 151 |
+
"encoder_model.onnx": true
|
| 152 |
+
}
|
| 153 |
+
},
|
| 154 |
"use_cache": true,
|
| 155 |
"use_weighted_layer_sum": false,
|
| 156 |
"vocab_size": 51865
|