Instructions to use Xenova/ms-marco-MiniLM-L-6-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use Xenova/ms-marco-MiniLM-L-6-v2 with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-classification', 'Xenova/ms-marco-MiniLM-L-6-v2');
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 (af7af6de8cf510e740e60997c62e0ae9eb549dc4)
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-6-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-6-v2`.
|
| 16 |
```js
|
| 17 |
-
import { AutoTokenizer, AutoModelForSequenceClassification } from '@
|
| 18 |
|
| 19 |
const model = await AutoModelForSequenceClassification.from_pretrained('Xenova/ms-marco-MiniLM-L-6-v2');
|
| 20 |
const tokenizer = await AutoTokenizer.from_pretrained('Xenova/ms-marco-MiniLM-L-6-v2');
|
|
@@ -31,7 +31,7 @@ const features = tokenizer(
|
|
| 31 |
}
|
| 32 |
)
|
| 33 |
|
| 34 |
-
const scores = await model(features)
|
| 35 |
console.log(scores);
|
| 36 |
// quantized: [ 8.663132667541504, -11.245542526245117 ]
|
| 37 |
// unquantized: [ 8.845855712890625, -11.245561599731445 ]
|
|
|
|
| 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-6-v2`.
|
| 16 |
```js
|
| 17 |
+
import { AutoTokenizer, AutoModelForSequenceClassification } from '@huggingface/transformers';
|
| 18 |
|
| 19 |
const model = await AutoModelForSequenceClassification.from_pretrained('Xenova/ms-marco-MiniLM-L-6-v2');
|
| 20 |
const tokenizer = await AutoTokenizer.from_pretrained('Xenova/ms-marco-MiniLM-L-6-v2');
|
|
|
|
| 31 |
}
|
| 32 |
)
|
| 33 |
|
| 34 |
+
const scores = await model(features);
|
| 35 |
console.log(scores);
|
| 36 |
// quantized: [ 8.663132667541504, -11.245542526245117 ]
|
| 37 |
// unquantized: [ 8.845855712890625, -11.245561599731445 ]
|
onnx/model_bnb4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9e31a2ab76617a5673ef39f9c6549f82b06b153c4f60bb56ffe3e8d680b7c557
|
| 3 |
+
size 54520695
|
onnx/model_int8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a13ec391ca99f49886694e12d3e800521f36d4267d7d448c34421c541a2baf50
|
| 3 |
+
size 23012404
|
onnx/model_q4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3ad0785ed300d2b408b9c92f886f733bb6e93a1bcc0c1ae23a296fb6cc2ddb44
|
| 3 |
+
size 55184019
|
onnx/model_q4f16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d860ca7adb7039a3e62c50833ce5c0940d89fb211a78dd498fb5e1f2eccd8773
|
| 3 |
+
size 30327072
|
onnx/model_uint8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c259e88ff6fdcc06da201969bd599f2effe2456fdf7510c1fa70929ece898f78
|
| 3 |
+
size 23012420
|