whitphx HF Staff commited on
Commit
baed8e3
Β·
verified Β·
1 Parent(s): 8e19882

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

Browse files

## Applied Quantizations

### βœ… Based on `model.onnx` *with* slimming

↳ βœ… `fp16`: `model_fp16.onnx` (added)
↳ βœ… `int8`: `model_int8.onnx` (added)
↳ βœ… `uint8`: `model_uint8.onnx` (added)
↳ βœ… `q4`: `model_q4.onnx` (added)
↳ βœ… `q4f16`: `model_q4f16.onnx` (added)
↳ βœ… `bnb4`: `model_bnb4.onnx` (added)

### βœ… Based on `model.onnx` *with* slimming

↳ βœ… `fp16`: `model_fp16.onnx` (added)
↳ βœ… `int8`: `model_int8.onnx` (added)
↳ βœ… `uint8`: `model_uint8.onnx` (added)
↳ βœ… `q4`: `model_q4.onnx` (added)
↳ βœ… `q4f16`: `model_q4f16.onnx` (added)
↳ βœ… `bnb4`: `model_bnb4.onnx` (added)

README.md CHANGED
@@ -5,4 +5,20 @@ library_name: transformers.js
5
 
6
  https://huggingface.co/Jean-Baptiste/camembert-ner 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/Jean-Baptiste/camembert-ner 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:** Perform named entity recognition.
16
+
17
+ ```js
18
+ import { pipeline } from '@huggingface/transformers';
19
+
20
+ const classifier = await pipeline('token-classification', 'Xenova/camembert-ner');
21
+ const output = await classifier('My name is Sarah and I live in London');
22
+ ```
23
+
24
  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:8aa49fc75f993b83f9f63dd6793d87cf0bdea90e3c2536bea10c404e926fa1c3
3
+ size 148491234
onnx/model_fp16.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:adc56709a32ded3524c3bef60c4ac4f8cfa7d1cdefc6c90037546baece9a1dd5
3
+ size 220385636
onnx/model_int8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b350d59b143450df78e9e4d5107c2f6c70b2f02dbe8124df93df6cc542ea6c99
3
+ size 110812101
onnx/model_q4.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:41de5ecc431a818822ec4ea0f0a9f9714b37aae6298c797fa36f76fbac11079c
3
+ size 153799354
onnx/model_q4f16.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa710fa9dbceed7b4e48afa99379bbd1d1335de012ef49094a43f2acafbc3eae
3
+ size 98297464
onnx/model_uint8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8137fbbd3e3b84fc1eb3a72144869c82aba31a76b2af8d769e078ffe56570598
3
+ size 110812142