whitphx HF Staff commited on
Commit
d8ef65c
·
verified ·
1 Parent(s): a54016c

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +6 -3
README.md CHANGED
@@ -5,17 +5,20 @@ library_name: transformers.js
5
 
6
  https://huggingface.co/openai/whisper-small.en with ONNX weights to be compatible with Transformers.js.
7
 
 
 
8
  If you haven't already, you can install the [Transformers.js](https://huggingface.co/docs/transformers.js) JavaScript library from [NPM](https://www.npmjs.com/package/@huggingface/transformers) using:
9
  ```bash
10
  npm i @huggingface/transformers
11
  ```
12
 
13
- 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`).
14
 
15
  ```js
16
  import { pipeline } from '@huggingface/transformers';
17
-
18
  const transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-small.en');
19
  const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';
20
  const output = await transcriber(url);
21
- ```
 
 
 
5
 
6
  https://huggingface.co/openai/whisper-small.en with ONNX weights to be compatible with Transformers.js.
7
 
8
+ ## Usage (Transformers.js)
9
+
10
  If you haven't already, you can install the [Transformers.js](https://huggingface.co/docs/transformers.js) JavaScript library from [NPM](https://www.npmjs.com/package/@huggingface/transformers) using:
11
  ```bash
12
  npm i @huggingface/transformers
13
  ```
14
 
15
+ **Example:** Transcribe audio from a URL.
16
 
17
  ```js
18
  import { pipeline } from '@huggingface/transformers';
 
19
  const transcriber = await pipeline('automatic-speech-recognition', 'Xenova/whisper-small.en');
20
  const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';
21
  const output = await transcriber(url);
22
+ ```
23
+
24
+ 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`).