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 (263e808c331cfc291de0f5446cdc8c11eb6e7feb)
Co-authored-by: Yuichiro Tachibana <[email protected]>
- 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-4017 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-4017 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-4017');
|
| 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:9285ffd279096c121b5b1e573e3624508b38dc979d953db9299669cc256968fb
|
| 3 |
+
size 623676527
|
onnx/model_q4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:786941f346b6a0f2cfa38a2deae1780063f6e1f311a3608f721f5155a4a22f7a
|
| 3 |
+
size 683516096
|
onnx/model_q4f16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:02a418827e7020bf64e876975b905ba4264d254fa268a734e963b64d4a340572
|
| 3 |
+
size 579745168
|
onnx/model_uint8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c072d8f2ad10ee81636e19f1bab8e4c1007e9e79a81f5d12245a80b2902e642e
|
| 3 |
+
size 974504498
|