Xenova HF Staff whitphx HF Staff commited on
Commit
975f195
·
verified ·
1 Parent(s): b79b4ef

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 (f3f91e1c0b607b717b88ff0c92a31c7a340fb675)


Co-authored-by: Yuichiro Tachibana <[email protected]>

README.md CHANGED
@@ -5,4 +5,21 @@ library_name: transformers.js
5
 
6
  https://huggingface.co/facebook/dino-vitb8 with ONNX weights to be compatible with Transformers.js.
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  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`).
 
5
 
6
  https://huggingface.co/facebook/dino-vitb8 with ONNX weights to be compatible with Transformers.js.
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 feature extraction.
16
+
17
+ ```js
18
+ import { pipeline } from '@huggingface/transformers';
19
+
20
+ const image_feature_extractor = await pipeline('image-feature-extraction', 'Xenova/dino-vitb8');
21
+ const url = 'https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/cats.png';
22
+ const features = await image_feature_extractor(url);
23
+ ```
24
+
25
  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:2f9bae3af8365e78ac50e3fc920735fe5aa5a74f4e4c54b88748c5826e9098d5
3
+ size 51463565
onnx/model_q4.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2fdde152be2d68333ffff932de41b3cc9dde4f1e328d10fc875869593d13bb0c
3
+ size 56771453
onnx/model_q4f16.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:06bcf494b879e5c3c76c675e9095ea3d40649fff62d0038006b85d4a4138e3b6
3
+ size 49716800
onnx/model_uint8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ee5b9d824164b843a36b25997e3d2c6be14966cbdec6a86c6266bae30d778f46
3
+ size 88258795