Xenova HF Staff whitphx HF Staff commited on
Commit
c973fa5
·
verified ·
1 Parent(s): fc1f16d

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 (d28f4d7ed728695ccf5611b8fb2905e5edbc256c)


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

README.md CHANGED
@@ -6,4 +6,23 @@ pipeline_tag: zero-shot-classification
6
 
7
  https://huggingface.co/cross-encoder/nli-deberta-base 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/cross-encoder/nli-deberta-base 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/nli-deberta-base');
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:3b1a97578bb984a25d136ee0b2c5f5df027884a64f983b7d8ba9f929ece9e6c0
3
+ size 216594887
onnx/model_int8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b2458f4ed45645d7a66fbc1096c9172737111acf09f24c61152750aae223c1d2
3
+ size 142452341
onnx/model_q4.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5dd244e2f167ad1a9f5d692f7605cca67a464342809052e6ce999f1fc428597b
3
+ size 222787499
onnx/model_q4f16.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a1273d6e57c140f0bd468617c3a8e261dc4041e04d3a5de62d76442fa7fab895
3
+ size 136386197
onnx/model_uint8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:57b91489a80b1577ae4ec3fd82c5d66cee236c453eda4e0a5f73249fa8a838ea
3
+ size 142452378