Xenova HF Staff whitphx commited on
Commit
ec9ff86
·
verified ·
1 Parent(s): d114a4b

Add/update the quantized ONNX model files and README.md for Transformers.js v3 (#2)

Browse files

- Add/update the quantized ONNX model files and README.md for Transformers.js v3 (58c020cb8f722fce22548d7041d5124d3097fa62)


Co-authored-by: Yuichiro Tachibana <whitphx@users.noreply.huggingface.co>

README.md CHANGED
@@ -6,4 +6,20 @@ pipeline_tag: feature-extraction
6
 
7
  https://huggingface.co/sentence-transformers/all-distilroberta-v1 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/sentence-transformers/all-distilroberta-v1 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:** Run feature extraction.
17
+
18
+ ```js
19
+ import { pipeline } from '@huggingface/transformers';
20
+
21
+ const extractor = await pipeline('feature-extraction', 'Xenova/all-distilroberta-v1');
22
+ const output = await extractor('This is a simple test.');
23
+ ```
24
+
25
  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:f071d95f02327806a2db56874137d9471d0909c271a3ba13b8f0669cce8b5d6b
3
+ size 180280241
onnx/model_int8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0b8799f84f80f1416de0109f1a2ef097ab37d5982e994424aee1bbd412d76d51
3
+ size 81901494
onnx/model_q4.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:532872949636231b51ea4ce35ad8c3547139881a7327ba09d66679ecd8595f7c
3
+ size 182934185
onnx/model_q4f16.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1dcfa25a149f85cf6e688d43a9b0337707ade3891f3095b1c8b7d152b3e3838d
3
+ size 102159190
onnx/model_uint8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cb5e6dda91f99c9a9de45246baf88a97f1bdf423e4e74e69b8711d18a9b2db6b
3
+ size 81901507