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

#1
by whitphx HF Staff - opened
README.md CHANGED
@@ -7,18 +7,18 @@ https://huggingface.co/YituTech/conv-bert-medium-small with ONNX weights to be c
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/@xenova/transformers) using:
11
  ```bash
12
- npm i @xenova/transformers
13
  ```
14
 
15
  **Example:** Feature extraction w/ `Xenova/conv-bert-medium-small`.
16
 
17
  ```javascript
18
- import { pipeline } from '@xenova/transformers';
19
 
20
  // Create feature extraction pipeline
21
- const extractor = await pipeline('feature-extraction', 'Xenova/conv-bert-medium-small', { quantized: false });
22
 
23
  // Perform feature extraction
24
  const output = await extractor('This is a test sentence.');
@@ -33,5 +33,4 @@ console.log(output)
33
 
34
  ---
35
 
36
-
37
  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`).
 
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:** Feature extraction w/ `Xenova/conv-bert-medium-small`.
16
 
17
  ```javascript
18
+ import { pipeline } from '@huggingface/transformers';
19
 
20
  // Create feature extraction pipeline
21
+ const extractor = await pipeline('feature-extraction', 'Xenova/conv-bert-medium-small', { dtype: "fp32" }); // Options: "fp32", "fp16", "q8", "q4"
22
 
23
  // Perform feature extraction
24
  const output = await extractor('This is a test sentence.');
 
33
 
34
  ---
35
 
 
36
  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:cb57c2671181d94853945e3fedc5f7c94463bfa6e55b9a3b6b2e225f37d90582
3
+ size 51698508
onnx/model_q4.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7563188c0022a199b3fbf16a7c35ad53c841929c31a58ab735b4965af87e3222
3
+ size 52037992
onnx/model_q4f16.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f9db79bba23b0065948cfd0deba80fe8aa8bf2491583eca018f2732480836127
3
+ size 27627345
onnx/model_uint8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:26ad7dac3319744ee6969182d0b5090dfd10543615f6342d999ad042a09eb9e4
3
+ size 18302304