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 (18eda71f7244803d35c018e87e45736fdffe6e8a)
Co-authored-by: Yuichiro Tachibana <[email protected]>
- 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-base 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-base 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-base');
|
| 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:cf85598f8d2e959242d843a5256f01a661f57425128449aa12708174efeb429d
|
| 3 |
+
size 51456602
|
onnx/model_q4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:404e6e48c312780ca972033152d4d44d280aeff6ce094b0cffb453751cd13617
|
| 3 |
+
size 56764490
|
onnx/model_q4f16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:933906ddc15f6304a7d9acd512f67cbb2443e14d3f4538b773fb30a49789bd4e
|
| 3 |
+
size 49712904
|
onnx/model_uint8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f104517cf005c1b1fe7a7b8759dfbf6c1def6092ddd23ae7e72b25578fe2bb44
|
| 3 |
+
size 86924739
|