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 (55643cd3586ee891b689f541662aa02b31efbc92)
Co-authored-by: Yuichiro Tachibana <[email protected]>
- README.md +16 -0
- onnx/model_bnb4.onnx +3 -0
- onnx/model_q4.onnx +3 -0
- onnx/model_q4f16.onnx +3 -0
- onnx/model_uint8.onnx +3 -0
README.md
CHANGED
|
@@ -6,4 +6,20 @@ pipeline_tag: feature-extraction
|
|
| 6 |
|
| 7 |
https://huggingface.co/squeezebert/squeezebert-uncased 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/squeezebert/squeezebert-uncased 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/squeezebert-uncased');
|
| 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:f4d238d247a4666b0b9fbf22df5c391a378e49025d57635701f7dead0806f9e6
|
| 3 |
+
size 202242121
|
onnx/model_q4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f4d238d247a4666b0b9fbf22df5c391a378e49025d57635701f7dead0806f9e6
|
| 3 |
+
size 202242121
|
onnx/model_q4f16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:19f59aa17bb1c71036bcbdfed0038ee2e52dd9b28a4c25f3d7c29e2e36b5ef39
|
| 3 |
+
size 101242542
|
onnx/model_uint8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fc7e3a44ba9d0cf8863e31c48ed07e9122beae2fe3ec4dd82bf9e9773c9ad7c1
|
| 3 |
+
size 51213618
|