Add/update the quantized ONNX model files and README.md for Transformers.js v3 (#1)
Browse files- Add/update the quantized ONNX model files and README.md for Transformers.js v3 (98aba10bcf6657588dd55f20e3e9a8315b25ea19)
Co-authored-by: Yuichiro Tachibana <[email protected]>
- README.md +19 -0
- onnx/model_bnb4.onnx +3 -0
- onnx/model_int8.onnx +3 -0
- onnx/model_q4.onnx +3 -0
- onnx/model_q4f16.onnx +3 -0
- onnx/model_uint8.onnx +3 -0
README.md
CHANGED
@@ -6,4 +6,23 @@ pipeline_tag: zero-shot-classification
|
|
6 |
|
7 |
https://huggingface.co/typeform/mobilebert-uncased-mnli with ONNX weights to be compatible with Transformers.js.
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
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`).
|
|
|
6 |
|
7 |
https://huggingface.co/typeform/mobilebert-uncased-mnli with ONNX weights to be compatible with Transformers.js.
|
8 |
|
9 |
+
## Usage (Transformers.js)
|
10 |
+
|
11 |
+
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:
|
12 |
+
```bash
|
13 |
+
npm i @huggingface/transformers
|
14 |
+
```
|
15 |
+
|
16 |
+
**Example:** Zero-shot classification with MobileBERT.
|
17 |
+
|
18 |
+
```js
|
19 |
+
import { pipeline } from '@huggingface/transformers';
|
20 |
+
|
21 |
+
const classifier = await pipeline('zero-shot-classification', 'Xenova/mobilebert-uncased-mnli');
|
22 |
+
const output = await classifier(
|
23 |
+
'I love transformers!',
|
24 |
+
['positive', 'negative']
|
25 |
+
);
|
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`).
|
onnx/model_bnb4.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7bcfc618bfda80833af1be0cb13689aebe549f9b9c7abcd1236a2dcc8e8ff26a
|
3 |
+
size 29616922
|
onnx/model_int8.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:48fd803f69f0ab11e4d7048af25ff575bc31c34041bd33f300dc48cbe5302407
|
3 |
+
size 26437902
|
onnx/model_q4.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:40f0cc649ea9bd1a7b1e644cc8cf90867411c12d6ed50181949afbdbe07b28bd
|
3 |
+
size 30879772
|
onnx/model_q4f16.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1027d49b34e4780b63602fd642961e9ba6f9fb7fc8c3bbf92d5d0256d49bd027
|
3 |
+
size 20954867
|
onnx/model_uint8.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a69db9c97aff0bb0e423038abcdb7c551bfde593abbbf6c497e813df5441118e
|
3 |
+
size 26438097
|