Add/update the quantized ONNX model files and README.md for Transformers.js v3
Browse files## Applied Quantizations
### ✅ Based on `model.onnx` *with* slimming
↳ ❌ `int8`: `model_int8.onnx` (added but JS-based E2E test failed)
```
/home/ubuntu/src/tjsmigration/node_modules/.pnpm/[email protected]/node_modules/onnxruntime-node/dist/backend.js:25
__classPrivateFieldGet(this, _OnnxruntimeSessionHandler_inferenceSession, "f").loadModel(pathOrBuffer, options);
^
Error: Could not find an implementation for ConvInteger(10) node with name '/convnext/embeddings/patch_embeddings/Conv_quant'
at new OnnxruntimeSessionHandler (/home/ubuntu/src/tjsmigration/node_modules/.pnpm/[email protected]/node_modules/onnxruntime-node/dist/backend.js:25:92)
at Immediate.<anonymous> (/home/ubuntu/src/tjsmigration/node_modules/.pnpm/[email protected]/node_modules/onnxruntime-node/dist/backend.js:67:29)
at process.processImmediate (node:internal/timers:485:21)
Node.js v22.16.0
```
↳ ✅ `uint8`: `model_uint8.onnx` (added)
↳ ✅ `q4`: `model_q4.onnx` (added)
↳ ✅ `q4f16`: `model_q4f16.onnx` (added)
↳ ✅ `bnb4`: `model_bnb4.onnx` (added)
- README.md +4 -4
- onnx/model_bnb4.onnx +3 -0
- onnx/model_q4.onnx +3 -0
- onnx/model_q4f16.onnx +3 -0
- onnx/model_uint8.onnx +3 -0
|
@@ -7,15 +7,15 @@ https://huggingface.co/facebook/convnext-large-224-22k with ONNX weights to be c
|
|
| 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:** Perform image classification with `Xenova/convnext-large-224-22k`.
|
| 16 |
|
| 17 |
```js
|
| 18 |
-
import { pipeline } from '@
|
| 19 |
|
| 20 |
// Create image classification pipeline
|
| 21 |
const classifier = await pipeline('image-classification', 'Xenova/convnext-large-224-22k');
|
|
@@ -23,7 +23,7 @@ const classifier = await pipeline('image-classification', 'Xenova/convnext-large
|
|
| 23 |
// Classify an image
|
| 24 |
const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';
|
| 25 |
const output = await classifier(url);
|
| 26 |
-
console.log(output)
|
| 27 |
```
|
| 28 |
|
| 29 |
---
|
|
|
|
| 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:** Perform image classification with `Xenova/convnext-large-224-22k`.
|
| 16 |
|
| 17 |
```js
|
| 18 |
+
import { pipeline } from '@huggingface/transformers';
|
| 19 |
|
| 20 |
// Create image classification pipeline
|
| 21 |
const classifier = await pipeline('image-classification', 'Xenova/convnext-large-224-22k');
|
|
|
|
| 23 |
// Classify an image
|
| 24 |
const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';
|
| 25 |
const output = await classifier(url);
|
| 26 |
+
console.log(output);
|
| 27 |
```
|
| 28 |
|
| 29 |
---
|
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7c1c7ed86e91f7a4bf903ef32b13d3d681d19e4194673ee859e41e2f9677c66f
|
| 3 |
+
size 271800129
|
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:32ec24e3c8694ff57aa93931243fcfa2cfeeb447f1f6c89aae6d21823fa51d6b
|
| 3 |
+
size 283577616
|
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2afa88b5f7de4945fa34ee14a9a098749f9f2061e56a1d9063ef19c47fe4e6c4
|
| 3 |
+
size 189097353
|
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:830374d8382973b825b446d475644939c7dd94d223f461c7532e1f8b6872b616
|
| 3 |
+
size 231205486
|