Transformers.js - Enable external data format in Node.js (#11)
Browse files- Transformers.js - Enable external data format in Node.js (636ff651dbca09c6ca319e7c68120d22c64f41b4)
- Update README.md (9786632e7429ac344fc96dc587011a4eb7e3e83d)
- README.md +3 -6
- config.json +7 -1
README.md
CHANGED
|
@@ -10,17 +10,14 @@ https://huggingface.co/vikhyatk/moondream2 with ONNX weights to be compatible wi
|
|
| 10 |
|
| 11 |
## Usage (Transformers.js)
|
| 12 |
|
| 13 |
-
|
| 14 |
-
> NOTE: Moondream support is experimental and requires you to install Transformers.js [v3](https://github.com/xenova/transformers.js/tree/v3) from source.
|
| 15 |
-
|
| 16 |
-
If you haven't already, you can install the [Transformers.js](https://huggingface.co/docs/transformers.js) JavaScript library from [GitHub](https://github.com/xenova/transformers.js/tree/v3) using:
|
| 17 |
```bash
|
| 18 |
-
npm install
|
| 19 |
```
|
| 20 |
|
| 21 |
**Example:**
|
| 22 |
```js
|
| 23 |
-
import { AutoProcessor, AutoTokenizer, Moondream1ForConditionalGeneration, RawImage } from '@
|
| 24 |
|
| 25 |
// Load processor, tokenizer and model
|
| 26 |
const model_id = 'Xenova/moondream2';
|
|
|
|
| 10 |
|
| 11 |
## Usage (Transformers.js)
|
| 12 |
|
| 13 |
+
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:
|
|
|
|
|
|
|
|
|
|
| 14 |
```bash
|
| 15 |
+
npm install @huggingface/transformers
|
| 16 |
```
|
| 17 |
|
| 18 |
**Example:**
|
| 19 |
```js
|
| 20 |
+
import { AutoProcessor, AutoTokenizer, Moondream1ForConditionalGeneration, RawImage } from '@huggingface/transformers';
|
| 21 |
|
| 22 |
// Load processor, tokenizer and model
|
| 23 |
const model_id = 'Xenova/moondream2';
|
config.json
CHANGED
|
@@ -37,5 +37,11 @@
|
|
| 37 |
},
|
| 38 |
"torch_dtype": "float16",
|
| 39 |
"transformers_version": "4.38.2",
|
| 40 |
-
"image_token_index": -200
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
}
|
|
|
|
| 37 |
},
|
| 38 |
"torch_dtype": "float16",
|
| 39 |
"transformers_version": "4.38.2",
|
| 40 |
+
"image_token_index": -200,
|
| 41 |
+
"transformers.js_config": {
|
| 42 |
+
"use_external_data_format": {
|
| 43 |
+
"decoder_model_merged.onnx": true,
|
| 44 |
+
"decoder_model_merged_fp16.onnx": true
|
| 45 |
+
}
|
| 46 |
+
}
|
| 47 |
}
|