Add/update the quantized ONNX model files and README.md for Transformers.js v3
#1
by
whitphx
- opened
- README.md +17 -0
- onnx/model_bnb4.onnx +3 -0
- onnx/model_q4.onnx +3 -0
- onnx/model_q4f16.onnx +3 -0
- onnx/model_uint8.onnx +3 -0
README.md
CHANGED
|
@@ -8,4 +8,21 @@ tags:
|
|
| 8 |
|
| 9 |
https://huggingface.co/microsoft/dit-large with ONNX weights to be compatible with Transformers.js.
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
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`).
|
|
|
|
| 8 |
|
| 9 |
https://huggingface.co/microsoft/dit-large with ONNX weights to be compatible with Transformers.js.
|
| 10 |
|
| 11 |
+
## Usage (Transformers.js)
|
| 12 |
+
|
| 13 |
+
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:
|
| 14 |
+
```bash
|
| 15 |
+
npm i @huggingface/transformers
|
| 16 |
+
```
|
| 17 |
+
|
| 18 |
+
**Example:** Perform image feature extraction.
|
| 19 |
+
|
| 20 |
+
```js
|
| 21 |
+
import { pipeline } from '@huggingface/transformers';
|
| 22 |
+
|
| 23 |
+
const image_feature_extractor = await pipeline('image-feature-extraction', 'Xenova/dit-large');
|
| 24 |
+
const url = 'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/cats.png';
|
| 25 |
+
const features = await image_feature_extractor(url);
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
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:00fe1fda4aa8812118cde0ab3a473228e7aeeb4abcdd7883acb0cc8b869c5446
|
| 3 |
+
size 175592478
|
onnx/model_q4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c20ff165515f5032b4ffed3e1c0bdb0c4de410be3a535f1b489d35a773a2469f
|
| 3 |
+
size 194465670
|
onnx/model_q4f16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b09abe28d798b97851e6a50333591c32b18ec7c8865143dae4e5514385a5c495
|
| 3 |
+
size 172922900
|
onnx/model_uint8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:23f946f9eceb918d4968a323614fb4cb87b869094bbef544ac760f3f307655f4
|
| 3 |
+
size 305510051
|