Add/update the quantized ONNX model files and README.md for Transformers.js v3
#2
by
whitphx
HF Staff
- opened
- README.md +17 -0
- onnx/model_bnb4.onnx +3 -0
- onnx/model_q4.onnx +3 -0
- onnx/model_q4f16.onnx +3 -0
- onnx/model_uint8.onnx +3 -0
README.md
CHANGED
@@ -7,4 +7,21 @@ tags:
|
|
7 |
|
8 |
https://huggingface.co/facebook/mms-lid-256 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-256 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 language identification.
|
18 |
+
|
19 |
+
```js
|
20 |
+
import { pipeline } from '@huggingface/transformers';
|
21 |
+
|
22 |
+
const classifier = await pipeline('audio-classification', 'Xenova/mms-lid-256');
|
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:082e5aa8bcabb8c12161db6bcde12e32caf024aa554a41e69152000ac585b802
|
3 |
+
size 608256425
|
onnx/model_q4.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8d98c785c7cf3b3973ea21a1fbbb88ff23291da3dd97f57d79409245e28407ac
|
3 |
+
size 668095994
|
onnx/model_q4f16.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:aa83deecb94a3e6efee5958b03660d1ca26ca1e3c71062027175d474acb66d69
|
3 |
+
size 572035116
|
onnx/model_uint8.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:32742f363c8a17a2f96d8d487f8e4c1bf77314c6149498333365459f2d71ad7f
|
3 |
+
size 970638185
|