Update README.md
Browse files
README.md
CHANGED
|
@@ -7,13 +7,15 @@ https://huggingface.co/openai/clip-vit-base-patch32 with ONNX weights to be comp
|
|
| 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/@
|
| 11 |
```bash
|
| 12 |
-
npm i @
|
| 13 |
```
|
| 14 |
|
| 15 |
**Example:** Perform zero-shot image classification with the `pipeline` API.
|
| 16 |
```js
|
|
|
|
|
|
|
| 17 |
const classifier = await pipeline('zero-shot-image-classification', 'Xenova/clip-vit-base-patch32');
|
| 18 |
const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';
|
| 19 |
const output = await classifier(url, ['tiger', 'horse', 'dog']);
|
|
|
|
| 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 zero-shot image classification with the `pipeline` API.
|
| 16 |
```js
|
| 17 |
+
import { pipeline } from '@huggingface/transformers';
|
| 18 |
+
|
| 19 |
const classifier = await pipeline('zero-shot-image-classification', 'Xenova/clip-vit-base-patch32');
|
| 20 |
const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';
|
| 21 |
const output = await classifier(url, ['tiger', 'horse', 'dog']);
|