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 (ea85188173c238928830c9049c03551e1fe30329)
Co-authored-by: Yuichiro Tachibana <whitphx@users.noreply.huggingface.co>
- README.md +4 -4
- 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
|
@@ -7,14 +7,14 @@ https://huggingface.co/cross-encoder/ms-marco-MiniLM-L-2-v2 with ONNX weights to
|
|
| 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/@
|
| 11 |
```bash
|
| 12 |
-
npm i @
|
| 13 |
```
|
| 14 |
|
| 15 |
**Example:** Information Retrieval w/ `Xenova/ms-marco-MiniLM-L-2-v2`.
|
| 16 |
```js
|
| 17 |
-
import { AutoTokenizer, AutoModelForSequenceClassification } from '@
|
| 18 |
|
| 19 |
const model = await AutoModelForSequenceClassification.from_pretrained('Xenova/ms-marco-MiniLM-L-2-v2');
|
| 20 |
const tokenizer = await AutoTokenizer.from_pretrained('Xenova/ms-marco-MiniLM-L-2-v2');
|
|
@@ -31,7 +31,7 @@ const features = tokenizer(
|
|
| 31 |
}
|
| 32 |
)
|
| 33 |
|
| 34 |
-
const scores = await model(features)
|
| 35 |
console.log(scores);
|
| 36 |
// quantized: [ 9.063430786132812, -11.72588062286377 ]
|
| 37 |
// unquantized: [ 8.843852043151855, -11.74354362487793 ]
|
|
|
|
| 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:** Information Retrieval w/ `Xenova/ms-marco-MiniLM-L-2-v2`.
|
| 16 |
```js
|
| 17 |
+
import { AutoTokenizer, AutoModelForSequenceClassification } from '@huggingface/transformers';
|
| 18 |
|
| 19 |
const model = await AutoModelForSequenceClassification.from_pretrained('Xenova/ms-marco-MiniLM-L-2-v2');
|
| 20 |
const tokenizer = await AutoTokenizer.from_pretrained('Xenova/ms-marco-MiniLM-L-2-v2');
|
|
|
|
| 31 |
}
|
| 32 |
)
|
| 33 |
|
| 34 |
+
const scores = await model(features);
|
| 35 |
console.log(scores);
|
| 36 |
// quantized: [ 9.063430786132812, -11.72588062286377 ]
|
| 37 |
// unquantized: [ 8.843852043151855, -11.74354362487793 ]
|
onnx/model_bnb4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:21dffc322519eb3d410ff8e452780722ac09247f882386d1ccc5b632bc9aaa54
|
| 3 |
+
size 50359445
|
onnx/model_int8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1857c1a59b01c1641a46a47fd85b01d98c6e15e1e48588eac1f6a97ff83479c7
|
| 3 |
+
size 15727674
|
onnx/model_q4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:502ef6a208c5d3fb2201766ace086ed958686a7c543caf56b942eb0e2829d8b0
|
| 3 |
+
size 50580553
|
onnx/model_q4f16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6f3f71f29e377347bce07bf60adc2751e956729d6f1d2808eab5c85e491c269a
|
| 3 |
+
size 26205942
|
onnx/model_uint8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7ee7f8e2a4c6a69e8fcbd0ee513ccb7843b55d2bd501f229aa9b3a5f5869c63f
|
| 3 |
+
size 15727686
|