Instructions to use Xenova/clip-vit-large-patch14-336 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use Xenova/clip-vit-large-patch14-336 with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('zero-shot-image-classification', 'Xenova/clip-vit-large-patch14-336');
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 (0bac652905a625d1ce176d7cf106e97f92105387)
Co-authored-by: Yuichiro Tachibana <whitphx@users.noreply.huggingface.co>
- 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
- onnx/text_model_bnb4.onnx +3 -0
- onnx/text_model_int8.onnx +3 -0
- onnx/text_model_q4.onnx +3 -0
- onnx/text_model_q4f16.onnx +3 -0
- onnx/text_model_uint8.onnx +3 -0
- onnx/vision_model_bnb4.onnx +3 -0
- onnx/vision_model_int8.onnx +3 -0
- onnx/vision_model_q4.onnx +3 -0
- onnx/vision_model_q4f16.onnx +3 -0
- onnx/vision_model_uint8.onnx +3 -0
README.md
CHANGED
|
@@ -5,4 +5,21 @@ library_name: transformers.js
|
|
| 5 |
|
| 6 |
https://huggingface.co/openai/clip-vit-large-patch14-336 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/openai/clip-vit-large-patch14-336 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:** Zero shot image classification.
|
| 16 |
+
|
| 17 |
+
```js
|
| 18 |
+
import { pipeline } from '@huggingface/transformers';
|
| 19 |
+
|
| 20 |
+
const classifier = await pipeline('zero-shot-image-classification', 'Xenova/clip-vit-large-patch14-336');
|
| 21 |
+
const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';
|
| 22 |
+
const output = await classifier(url, ['tiger', 'horse', 'dog']);
|
| 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:d614f0b873a42600205df0d9997758d6f2939aac498495b48d209df7d40a24c2
|
| 3 |
+
size 377786948
|
onnx/model_q4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c994ffa88f8ee76af0c4a1863559d4364c4c1ed43c6f46368baa53b35a80d839
|
| 3 |
+
size 402054030
|
onnx/model_q4f16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dc22fb51b0416b157dac0870812a8489fe3244db3c5f6c07ba45810d72a103ce
|
| 3 |
+
size 298499012
|
onnx/model_uint8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6f7e116d812237f916e0eabc2454c6f27caeb5a1492fd4bcebe3b741023d50b9
|
| 3 |
+
size 432101625
|
onnx/text_model_bnb4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c811aa4878e7109ff49bbfa5aa30374e966f9132b124ef5923a3263a561bf90c
|
| 3 |
+
size 200927902
|
onnx/text_model_int8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5738b04d603d5ce0241e1f3331f33d05486da19a6e7c5e1379d8436f61d3f756
|
| 3 |
+
size 124414449
|
onnx/text_model_q4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:da7ba52505d52196252ddbaea8b19781ba9298934fc9f46dfdfe093079041ee1
|
| 3 |
+
size 206272647
|
onnx/text_model_q4f16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:72920e2c3b75e0fc1ba62204372aa0c5a53cc48adba7c7d138e4f86b81afc7a5
|
| 3 |
+
size 124675686
|
onnx/text_model_uint8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7c2e76fb3955ae5b244d86e006f7458f3704a1089a174a504e4d871405cf6ca1
|
| 3 |
+
size 124414483
|
onnx/vision_model_bnb4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a1247095de0c289c148aa733933ec805a535a32788f2a17550d9db3513a13197
|
| 3 |
+
size 176831728
|
onnx/vision_model_int8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2bf8478a126c4c354b46d57483f7e501c1ec714518b90f4a9615c6d067ac4e0f
|
| 3 |
+
size 307659474
|
onnx/vision_model_q4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:664c0dbf3da33dfab37a93a7853dce023673221db61616e0de0d5a0236bc9ec9
|
| 3 |
+
size 195754065
|
onnx/vision_model_q4f16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:094faadfe09adc5705cdfd72b097e2a89929fb909704207b5b73bcb1c849ce32
|
| 3 |
+
size 173795553
|
onnx/vision_model_uint8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4a54916a1bb8a98987657c2282f2c3c751287e389e298053b59a5e0160497f51
|
| 3 |
+
size 307659546
|