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 (039518c8387486f27d9995e42ddc978c43c42d20)
Co-authored-by: Yuichiro Tachibana <[email protected]>
- README.md +16 -0
- onnx/model.onnx +3 -0
- onnx/model_bnb4.onnx +3 -0
- onnx/model_fp16.onnx +3 -0
- onnx/model_int8.onnx +3 -0
- onnx/model_q4.onnx +3 -0
- onnx/model_q4f16.onnx +3 -0
- onnx/model_uint8.onnx +3 -0
README.md
CHANGED
|
@@ -5,4 +5,20 @@ library_name: transformers.js
|
|
| 5 |
|
| 6 |
https://huggingface.co/JackFram/llama-68m 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/JackFram/llama-68m 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:** Text generation.
|
| 16 |
+
|
| 17 |
+
```js
|
| 18 |
+
import { pipeline } from '@huggingface/transformers';
|
| 19 |
+
|
| 20 |
+
const generator = await pipeline('text-generation', 'Xenova/llama-68m');
|
| 21 |
+
const output = await generator('Once upon a time, there was', { max_new_tokens: 10 });
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
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.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2702ba2c6d4352a6897dd68cdda2363a1008b6b62b3e207914ae4046d44b28c0
|
| 3 |
+
size 274375225
|
onnx/model_bnb4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9a3c2b895a348d14aeb17334b89e9ba425c63d4ab93fcf8a1477dead2477387c
|
| 3 |
+
size 123925698
|
onnx/model_fp16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:850367e8b4a7e6aeee641aa56306e37091d8be9cc3fbd8c30541f93285a2b0f4
|
| 3 |
+
size 136699224
|
onnx/model_int8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d30b0000fc57b46856ec98bc5046340dc81ce029797b4da69a6c966b8988bd6c
|
| 3 |
+
size 69234911
|
onnx/model_q4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:37dfaec0d2a1ab7323eb2577a7affa07596a1bc46eafd794724bc00dd72ac4b7
|
| 3 |
+
size 126641101
|
onnx/model_q4f16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:be0e4ed7778bfecee45e984cba351b23e9d2fdfcf5eef7159fea55f12c07c696
|
| 3 |
+
size 74243531
|
onnx/model_uint8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:55ce4d31174421c587b28ee173b4ab03d6daa68e89b56ed267ab26ccc16266df
|
| 3 |
+
size 69234917
|