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 (6ccdc4006c6ee718968dd83d69e4f687704c74bd)
Co-authored-by: Yuichiro Tachibana <[email protected]>
- README.md +16 -0
- onnx/model_bnb4.onnx +3 -0
- onnx/model_int8.onnx +3 -0
- onnx/model_q4.onnx +3 -0
- onnx/model_q4f16.onnx +3 -0
- onnx/model_uint8.onnx +3 -0
README.md
CHANGED
|
@@ -5,4 +5,20 @@ library_name: transformers.js
|
|
| 5 |
|
| 6 |
https://huggingface.co/sentence-transformers/distilbert-base-nli-mean-tokens 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/sentence-transformers/distilbert-base-nli-mean-tokens 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 feature extraction.
|
| 16 |
+
|
| 17 |
+
```js
|
| 18 |
+
import { pipeline } from '@huggingface/transformers';
|
| 19 |
+
|
| 20 |
+
const extractor = await pipeline('feature-extraction', 'Xenova/distilbert-base-nli-mean-tokens');
|
| 21 |
+
const output = await extractor('This is a simple test.');
|
| 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:18542de2590930862ef2ed16e13bb79ce720b8686d80ae3917991e2318a2c93b
|
| 3 |
+
size 119594843
|
onnx/model_int8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:28d5408a9b5c447e0b24e66971f983e424238cbf4e04e7c422faa37fbde466dd
|
| 3 |
+
size 66709270
|
onnx/model_q4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0ffdbd0cc59ca981352ebaf71e2842842cfe41fbf18dee68e83fff260d9655e4
|
| 3 |
+
size 122248787
|
onnx/model_q4f16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e4e7c5a94459243ba5e2451290bffbc40cc1d92d069c741aa9294b3972aa6e08
|
| 3 |
+
size 71803497
|
onnx/model_uint8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b59494149db3fb8e86d22cb7c949d82c27202890029f28b563f1d81c8fabb155
|
| 3 |
+
size 66709292
|