whitphx HF Staff commited on
Commit
a7509c6
·
verified ·
1 Parent(s): 1006211

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +3 -3
README.md CHANGED
@@ -16,13 +16,13 @@ npm i @huggingface/transformers
16
  import { pipeline } from '@huggingface/transformers';
17
 
18
  // Create the pipeline
19
- const pipe = await pipeline('automatic-speech-recognition', 'Xenova/whisper-large-v3', {
20
  dtype: 'fp32', // Options: "fp32", "fp16", "q8", "q4"
21
  });
22
 
23
  // Use the model
24
- const result = await pipe('input text or data');
25
- console.log(result);
26
  ```
27
 
28
  Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using [🤗 Optimum](https://huggingface.co/docs/optimum/index) and structuring your repo like this one (with ONNX weights located in a subfolder named `onnx`).
 
16
  import { pipeline } from '@huggingface/transformers';
17
 
18
  // Create the pipeline
19
+ const transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-large-v3', {
20
  dtype: 'fp32', // Options: "fp32", "fp16", "q8", "q4"
21
  });
22
 
23
  // Use the model
24
+ const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';
25
+ const output = await transcriber(url);
26
  ```
27
 
28
  Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using [🤗 Optimum](https://huggingface.co/docs/optimum/index) and structuring your repo like this one (with ONNX weights located in a subfolder named `onnx`).