Add/update the quantized ONNX model files and README.md for Transformers.js v3
Browse files## Applied Quantizations
### ✅ Based on `model.onnx` *with* slimming
↳ ✅ `q4f16`: `model_q4f16.onnx` (added)
### ✅ Based on `model.onnx` *with* slimming
↳ ✅ `q4f16`: `model_q4f16.onnx` (added)
- README.md +16 -0
- onnx/model_q4f16.onnx +3 -0
README.md
CHANGED
|
@@ -6,4 +6,20 @@ license: other
|
|
| 6 |
|
| 7 |
https://huggingface.co/apple/OpenELM-450M-Instruct with ONNX weights to be compatible with Transformers.js.
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
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`).
|
|
|
|
| 6 |
|
| 7 |
https://huggingface.co/apple/OpenELM-450M-Instruct with ONNX weights to be compatible with Transformers.js.
|
| 8 |
|
| 9 |
+
## Usage (Transformers.js)
|
| 10 |
+
|
| 11 |
+
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:
|
| 12 |
+
```bash
|
| 13 |
+
npm i @huggingface/transformers
|
| 14 |
+
```
|
| 15 |
+
|
| 16 |
+
**Example:** Text generation.
|
| 17 |
+
|
| 18 |
+
```js
|
| 19 |
+
import { pipeline } from '@huggingface/transformers';
|
| 20 |
+
|
| 21 |
+
const generator = await pipeline('text-generation', 'Xenova/OpenELM-450M-Instruct');
|
| 22 |
+
const output = await generator('Once upon a time, there was', { max_new_tokens: 10 });
|
| 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_q4f16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:48e198c465540c9f4df13eb0b31848b1d9a01df30972f2f876103c16b9418b5b
|
| 3 |
+
size 361520988
|