Update to Transformers.js v3
Browse files
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 |
|