Xenova HF Staff whitphx HF Staff commited on
Commit
71a9d2a
·
verified ·
1 Parent(s): c3a5b86

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 (807dae873b0e09da9c97624787ae0e043774c8d9)


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

README.md CHANGED
@@ -6,4 +6,22 @@ pipeline_tag: zero-shot-classification
6
 
7
  https://huggingface.co/facebook/bart-large-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/facebook/bart-large-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 text classification.
17
+
18
+ ```js
19
+ import { pipeline } from '@huggingface/transformers';
20
+
21
+ const classifier = await pipeline('text-classification', 'Xenova/bart-large-mnli');
22
+ const output = await classifier('I love transformers!', {
23
+ candidate_labels: ['positive', 'negative']
24
+ });
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:8fcbdff205194c7956ce4641004dc17c4f151f7b09e7e6c3e95cbee191950e96
3
+ size 419119596
onnx/model_int8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:216773e760f0500ed3e1fe4f9a5265d658e5fd59aea29a2867b891bc7977f46e
3
+ size 409595949
onnx/model_q4.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:98cdbb36c3aabf84615825c6248ad4773182ce45d7883c3343ab16959b53b3b7
3
+ size 441138132
onnx/model_q4f16.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3ca7e46e95ec96f288de0af70762fce4b03d45a680d0b72b33e8d7c751487fe6
3
+ size 309073732
onnx/model_uint8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d4994b95ba2fc93bc54a2e5431ec906f9929adf429d44d476485be8762b8d6d3
3
+ size 409596053