Add/update the quantized ONNX model files and README.md for Transformers.js v3
#1
by
whitphx
- opened
README.md
CHANGED
|
@@ -7,15 +7,15 @@ https://huggingface.co/nvidia/mit-b1 with ONNX weights to be compatible with Tra
|
|
| 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 image classification with `Xenova/mit-b1`.
|
| 16 |
|
| 17 |
```js
|
| 18 |
-
import { pipeline } from '@
|
| 19 |
|
| 20 |
// Create image classification pipeline
|
| 21 |
const classifier = await pipeline('image-classification', 'Xenova/mit-b1');
|
|
@@ -23,7 +23,7 @@ const classifier = await pipeline('image-classification', 'Xenova/mit-b1');
|
|
| 23 |
// Classify an image
|
| 24 |
const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';
|
| 25 |
const output = await classifier(url);
|
| 26 |
-
console.log(output)
|
| 27 |
// [{ label: 'tiger, Panthera tigris', score: 0.5473673343658447 }]
|
| 28 |
```
|
| 29 |
|
|
|
|
| 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 classification with `Xenova/mit-b1`.
|
| 16 |
|
| 17 |
```js
|
| 18 |
+
import { pipeline } from '@huggingface/transformers';
|
| 19 |
|
| 20 |
// Create image classification pipeline
|
| 21 |
const classifier = await pipeline('image-classification', 'Xenova/mit-b1');
|
|
|
|
| 23 |
// Classify an image
|
| 24 |
const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/tiger.jpg';
|
| 25 |
const output = await classifier(url);
|
| 26 |
+
console.log(output);
|
| 27 |
// [{ label: 'tiger, Panthera tigris', score: 0.5473673343658447 }]
|
| 28 |
```
|
| 29 |
|