Xenova HF Staff whitphx HF Staff commited on
Commit
02c7ace
·
verified ·
1 Parent(s): 7fe0029

Add/update the quantized ONNX model files and README.md for Transformers.js v3 (#2)

Browse files

- Add/update the quantized ONNX model files and README.md for Transformers.js v3 (7a4c4241b8a06cde4150b0c917a3af5f96b13325)


Co-authored-by: Yuichiro Tachibana <[email protected]>

README.md CHANGED
@@ -7,4 +7,21 @@ tags:
7
 
8
  https://huggingface.co/facebook/mms-lid-2048 with ONNX weights to be compatible with Transformers.js.
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  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`).
 
7
 
8
  https://huggingface.co/facebook/mms-lid-2048 with ONNX weights to be compatible with Transformers.js.
9
 
10
+ ## Usage (Transformers.js)
11
+
12
+ 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:
13
+ ```bash
14
+ npm i @huggingface/transformers
15
+ ```
16
+
17
+ **Example:** Perform audio classification.
18
+
19
+ ```js
20
+ import { pipeline } from '@huggingface/transformers';
21
+
22
+ const classifier = await pipeline('audio-classification', 'Xenova/mms-lid-2048');
23
+ const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav';
24
+ const output = await classifier(url);
25
+ ```
26
+
27
  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`).
onnx/model_bnb4.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:73e4f94e5f2cb1518d6d5fc7a05fd6e1d54c4dbe4653ddcdec8b4a88f4aee7f4
3
+ size 615603627
onnx/model_q4.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7b16b6060247b01c9426f3408360f02fcaad4979a08341a2ffa7ee11e892c036
3
+ size 675443196
onnx/model_q4f16.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b743ed0fead686094169a1f2bf07b9e188496c2480254f599d4626f855dd5331
3
+ size 575708718
onnx/model_uint8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5352c2e406fa5a66727434df88198793fce424c2598abc61d5be0e6e0b18b0e1
3
+ size 972480373