Xenova HF Staff whitphx HF Staff commited on
Commit
ac4f4e5
·
verified ·
1 Parent(s): 32c628b

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 (36420ab336f91658df56c46cad8e57c359ff214c)


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

README.md CHANGED
@@ -5,4 +5,22 @@ library_name: transformers.js
5
 
6
  https://huggingface.co/distilbert-base-uncased-distilled-squad with ONNX weights to be compatible with Transformers.js.
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  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`).
 
5
 
6
  https://huggingface.co/distilbert-base-uncased-distilled-squad with ONNX weights to be compatible with Transformers.js.
7
 
8
+ ## Usage (Transformers.js)
9
+
10
+ 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:
11
+ ```bash
12
+ npm i @huggingface/transformers
13
+ ```
14
+
15
+ **Example:** Run question answering.
16
+
17
+ ```js
18
+ import { pipeline } from '@huggingface/transformers';
19
+
20
+ const answerer = await pipeline('question-answering', 'Xenova/distilbert-base-uncased-distilled-squad');
21
+ const question = 'Who was Jim Henson?';
22
+ const context = 'Jim Henson was a nice puppet.';
23
+ const output = await answerer(question, context);
24
+ ```
25
+
26
  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:8061b3beee5e1579c67bed9594233b6252bb091fa75e70a8eed9160482d263ce
3
+ size 119617748
onnx/model_int8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:94c0e91da04fec7dfd2d50af5d722c73c860d2df74376688d245ccce64cf6b8e
3
+ size 66739694
onnx/model_q4.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:988e30e6e92841255af8069be1a89e8c342748c0d35eea8db5501254c15f486e
3
+ size 122271782
onnx/model_q4f16.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:70022675f716bd350a029b867518956161c2ee828400dd1f97cd8ecf4d12dc7f
3
+ size 71826412
onnx/model_uint8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:080b16e1572c6eb7d95f52013d55de41d4218fa09231e23c932030bceeef7966
3
+ size 66739716