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 (4205b8a9c6fdec5cfe8aff7702959625bed67e87)
Co-authored-by: Yuichiro Tachibana <[email protected]>
- README.md +4 -5
- 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,15 +7,15 @@ https://huggingface.co/BAAI/bge-large-en-v1.5 with ONNX weights to be compatible
|
|
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 |
You can then use the model to compute embeddings, as follows:
|
16 |
|
17 |
```js
|
18 |
-
import { pipeline } from '@
|
19 |
|
20 |
// Create a feature-extraction pipeline
|
21 |
const extractor = await pipeline('feature-extraction', 'Xenova/bge-large-en-v1.5');
|
@@ -40,7 +40,7 @@ console.log(embeddings.tolist()); // Convert embeddings to a JavaScript list
|
|
40 |
|
41 |
You can also use the model for retrieval. For example:
|
42 |
```js
|
43 |
-
import { pipeline, cos_sim } from '@
|
44 |
|
45 |
// Create a feature-extraction pipeline
|
46 |
const extractor = await pipeline('feature-extraction', 'Xenova/bge-large-en-v1.5');
|
@@ -76,5 +76,4 @@ console.log(scores);
|
|
76 |
// ]
|
77 |
```
|
78 |
|
79 |
-
|
80 |
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 |
You can then use the model to compute embeddings, as follows:
|
16 |
|
17 |
```js
|
18 |
+
import { pipeline } from '@huggingface/transformers';
|
19 |
|
20 |
// Create a feature-extraction pipeline
|
21 |
const extractor = await pipeline('feature-extraction', 'Xenova/bge-large-en-v1.5');
|
|
|
40 |
|
41 |
You can also use the model for retrieval. For example:
|
42 |
```js
|
43 |
+
import { pipeline, cos_sim } from '@huggingface/transformers';
|
44 |
|
45 |
// Create a feature-extraction pipeline
|
46 |
const extractor = await pipeline('feature-extraction', 'Xenova/bge-large-en-v1.5');
|
|
|
76 |
// ]
|
77 |
```
|
78 |
|
|
|
79 |
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:91e16945f0836be1dda5d4e389357958723bf4e9e2767ecead8f4642e24f29ad
|
3 |
+
size 298852121
|
onnx/model_int8.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:81862c1d889c334792a0e71b9d7eb6687a623acadfc81875c9590141996abf0d
|
3 |
+
size 335783481
|
onnx/model_q4.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a3c8860b34a399faf5b7d22002bd2b9b7eba491c53c00346e58c5ec474ec747a
|
3 |
+
size 317725313
|
onnx/model_q4f16.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2ddc538002dbc8c4eafdfa83b907bb66f1aa02d3348b151d819abd8284c75ff8
|
3 |
+
size 234646267
|
onnx/model_uint8.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:62af89b4d530ff25a1769e7290e32b7e1edb229b0077c0530fc28d2dc2446c12
|
3 |
+
size 335783546
|