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 (6d8a1704cff119cf6dac50ef4e7a3899ef590626)
Co-authored-by: Yuichiro Tachibana <whitphx@users.noreply.huggingface.co>
- 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/distilbert-base-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/distilbert-base-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.
|
17 |
+
|
18 |
+
```js
|
19 |
+
import { pipeline } from '@huggingface/transformers';
|
20 |
+
|
21 |
+
const classifier = await pipeline('zero-shot-classification', 'Xenova/distilbert-base-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:f71c227ffa841a7c381c9a9d1e5ee3c7b687a7e63548995725e46dfb4e8425f1
|
3 |
+
size 121988185
|
onnx/model_int8.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ebfda67883e5df1ffb544043ae47ae64dd4cd9084ae595032f3662ff5050d651
|
3 |
+
size 67333959
|
onnx/model_q4.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1aab657f487b6edf29ea260c4c4cc67aee610417fb93f5e9016700f5a6173db9
|
3 |
+
size 124642129
|
onnx/model_q4f16.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bad834ed796defb6cb616ef68430575f432720406db6e669395b83347c9335a4
|
3 |
+
size 73011037
|
onnx/model_uint8.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3992b54042564e189c6667e33047802930f99bb70159d16aa6eb3f55a2ad658e
|
3 |
+
size 67333983
|