Add listed support for Transformers.js
#5
by
Xenova
HF staff
- opened
README.md
CHANGED
@@ -4,6 +4,7 @@ language:
|
|
4 |
tags:
|
5 |
- audio
|
6 |
- automatic-speech-recognition
|
|
|
7 |
widget:
|
8 |
- example_title: LibriSpeech sample 1
|
9 |
src: https://cdn-media.huggingface.co/speech_samples/sample1.flac
|
@@ -244,6 +245,21 @@ Coming soon ...
|
|
244 |
|
245 |
Coming soon ...
|
246 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
## Model Details
|
248 |
|
249 |
Distil-Whisper inherits the encoder-decoder architecture from Whisper. The encoder maps a sequence of speech vector
|
|
|
4 |
tags:
|
5 |
- audio
|
6 |
- automatic-speech-recognition
|
7 |
+
- transformers.js
|
8 |
widget:
|
9 |
- example_title: LibriSpeech sample 1
|
10 |
src: https://cdn-media.huggingface.co/speech_samples/sample1.flac
|
|
|
245 |
|
246 |
Coming soon ...
|
247 |
|
248 |
+
### Transformers.js
|
249 |
+
|
250 |
+
```js
|
251 |
+
import { pipeline } from '@xenova/transformers';
|
252 |
+
|
253 |
+
let transcriber = await pipeline('automatic-speech-recognition', 'distil-whisper/distil-medium.en');
|
254 |
+
|
255 |
+
let url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';
|
256 |
+
let output = await transcriber(url);
|
257 |
+
// { text: " And so my fellow Americans, ask not what your country can do for you. Ask what you can do for your country." }
|
258 |
+
```
|
259 |
+
|
260 |
+
See the [docs](https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.AutomaticSpeechRecognitionPipeline) for more information.
|
261 |
+
|
262 |
+
|
263 |
## Model Details
|
264 |
|
265 |
Distil-Whisper inherits the encoder-decoder architecture from Whisper. The encoder maps a sequence of speech vector
|