Xenova HF Staff whitphx HF Staff commited on
Commit
86785f7
·
verified ·
1 Parent(s): 5dc2f63

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 (26e6bc6c62278169667b8f9717b3570c66cc90d1)


Co-authored-by: Yuichiro Tachibana <whitphx@users.noreply.huggingface.co>

README.md CHANGED
@@ -5,4 +5,21 @@ library_name: transformers.js
5
 
6
  https://huggingface.co/hustvl/yolos-small-dwr 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/hustvl/yolos-small-dwr 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:** Run object-detection.
16
+
17
+ ```js
18
+ import { pipeline } from '@huggingface/transformers';
19
+
20
+ const detector = await pipeline('object-detection', 'Xenova/yolos-small-dwr');
21
+ const img = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg';
22
+ const output = await detector(img, { threshold: 0.9 });
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:d833276e96411ef4678966eff1506d7a3436581c8b29f0405957abf816fac873
3
+ size 46142766
onnx/model_q4.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:26e4b4985dc12a5b7d9fbdd2b3d6dae74c372960288bd5afcdc64d909d1b34ae
3
+ size 47911480
onnx/model_q4f16.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:52d4fc2ed22425d5032288ad2f428d3d3cb8fb6813bf8645bfce0e2bedc478b4
3
+ size 45048185
onnx/model_uint8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e1c724bcf9b3b9abf8cf8624d1aff5f741b2454fb6dc59d23afe6712217098a0
3
+ size 53692860