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 (a0d0ce1671bbcee7354ad244cc606877f0ee10fe)
Co-authored-by: Yuichiro Tachibana <whitphx@users.noreply.huggingface.co>
- README.md +26 -0
- onnx/decoder_model_bnb4.onnx +3 -0
- onnx/decoder_model_fp16.onnx +3 -0
- onnx/decoder_model_int8.onnx +3 -0
- onnx/decoder_model_merged_bnb4.onnx +3 -0
- onnx/decoder_model_merged_fp16.onnx +2 -2
- onnx/decoder_model_merged_int8.onnx +3 -0
- onnx/decoder_model_merged_q4.onnx +3 -0
- onnx/decoder_model_merged_q4f16.onnx +3 -0
- onnx/decoder_model_merged_uint8.onnx +3 -0
- onnx/decoder_model_q4.onnx +3 -0
- onnx/decoder_model_q4f16.onnx +3 -0
- onnx/decoder_model_uint8.onnx +3 -0
- onnx/decoder_with_past_model_bnb4.onnx +3 -0
- onnx/decoder_with_past_model_fp16.onnx +3 -0
- onnx/decoder_with_past_model_int8.onnx +3 -0
- onnx/decoder_with_past_model_q4.onnx +3 -0
- onnx/decoder_with_past_model_q4f16.onnx +3 -0
- onnx/decoder_with_past_model_uint8.onnx +3 -0
- onnx/encoder_model_bnb4.onnx +3 -0
- onnx/encoder_model_int8.onnx +3 -0
- onnx/encoder_model_q4.onnx +3 -0
- onnx/encoder_model_q4f16.onnx +3 -0
- onnx/encoder_model_uint8.onnx +3 -0
README.md
CHANGED
@@ -6,4 +6,30 @@ pipeline_tag: summarization
|
|
6 |
|
7 |
https://huggingface.co/sshleifer/distilbart-cnn-12-3 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/sshleifer/distilbart-cnn-12-3 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:** Summarization.
|
17 |
+
|
18 |
+
```js
|
19 |
+
import { pipeline } from '@huggingface/transformers';
|
20 |
+
|
21 |
+
const generator = await pipeline('summarization', 'Xenova/distilbart-cnn-12-3');
|
22 |
+
const text = 'The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, ' +
|
23 |
+
'and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. ' +
|
24 |
+
'During its construction, the Eiffel Tower surpassed the Washington Monument to become the tallest ' +
|
25 |
+
'man-made structure in the world, a title it held for 41 years until the Chrysler Building in New ' +
|
26 |
+
'York City was finished in 1930. It was the first structure to reach a height of 300 metres. Due to ' +
|
27 |
+
'the addition of a broadcasting aerial at the top of the tower in 1957, it is now taller than the ' +
|
28 |
+
'Chrysler Building by 5.2 metres (17 ft). Excluding transmitters, the Eiffel Tower is the second ' +
|
29 |
+
'tallest free-standing structure in France after the Millau Viaduct.';
|
30 |
+
const output = await generator(text, {
|
31 |
+
max_new_tokens: 100,
|
32 |
+
});
|
33 |
+
```
|
34 |
+
|
35 |
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/decoder_model_bnb4.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7e9f6b1f8f5a5c34900f9e95524c8477172bfae37e929a5e7f2ae3a97be08356
|
3 |
+
size 238784468
|
onnx/decoder_model_fp16.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e8e2357b70dfdc01355c56c5c9171aa5292886c669166fb2cc620d68fad7ad64
|
3 |
+
size 205969906
|
onnx/decoder_model_int8.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b92f0b8d20430ff079a28c1d82e0c23e97c80d2c707fb1d6f60452f8fcb74d8d
|
3 |
+
size 103274305
|
onnx/decoder_model_merged_bnb4.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d1148a1d628b5b0a1850e54645ac76f0d9f37c47841dc5542abbb7047acdff2f
|
3 |
+
size 239140492
|
onnx/decoder_model_merged_fp16.onnx
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:31310b7a0d216e21c639e330131a87b7adf9dbc525ac0876194abdc1e23bf5f0
|
3 |
+
size 206226113
|
onnx/decoder_model_merged_int8.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:64130a20b8b5c2efd2a3a5bcdb21e54fbd04045162af66e823fcb87004b7d591
|
3 |
+
size 103657502
|
onnx/decoder_model_merged_q4.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e2ce42be438877505a4a0d1f02cb2d959937a367724faf917ae6294fdaf9f11d
|
3 |
+
size 242285761
|
onnx/decoder_model_merged_q4f16.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8bf6b409edd77a978cf7fb0568eafbf4632eba71fb555b6151989e96bde05dad
|
3 |
+
size 133882125
|
onnx/decoder_model_merged_uint8.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3fcf288e068a826a8bc3c29be513457bdc02e8f13778bd026e013efcc628debf
|
3 |
+
size 103657516
|
onnx/decoder_model_q4.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:2ec62b0ad6a7b43db9adc74952160cccf32f406c92f1a850d2d0de4af175ac4a
|
3 |
+
size 241929953
|
onnx/decoder_model_q4f16.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7a81dcf8eb75f1175ffd1cc2c700c0e898571635b3f7806ff2c7dadee546818d
|
3 |
+
size 133622636
|
onnx/decoder_model_uint8.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d8ab3b14234ded330a6f9a202b7726d338cf80438e7d380ba500c99d558961b0
|
3 |
+
size 103274319
|
onnx/decoder_with_past_model_bnb4.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:5bab3f4aba43ae1abc990710e4137dafc7e8a137676507737ffc9652481d19bd
|
3 |
+
size 235184859
|
onnx/decoder_with_past_model_fp16.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a61c440dd029187ebe8274ceeec1e5fa217d3036412776459c2eec5e03f51483
|
3 |
+
size 193341783
|
onnx/decoder_with_past_model_int8.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9398caa1579168e9133a907d9c4460ba177a4bec302c510e7d1302398f214292
|
3 |
+
size 96917077
|
onnx/decoder_with_past_model_q4.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:32b293c32ee42ee96e662c70507fe96d77ebfe1fa102de25abd938a2208a2bc3
|
3 |
+
size 237937176
|
onnx/decoder_with_past_model_q4f16.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:24e7bfddf6c295b8f0116cade714655a1322f253290aecda21bf531f5300027a
|
3 |
+
size 130037577
|
onnx/decoder_with_past_model_uint8.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6f5c590982b7cbb2ea6c609ca81cc1d7ce3e5625d9d238a6616c9e7256dd2c11
|
3 |
+
size 96917088
|
onnx/encoder_model_bnb4.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:69ae3940438ea72b4c1bdd0cdcccba9ed5af0a1846b6c98248f6e6d1ef23afb1
|
3 |
+
size 295912467
|
onnx/encoder_model_int8.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4ced420079c1949f45fc7b543cf9a8f5146f94d0154fbdf661a1c09e60f47c34
|
3 |
+
size 204472178
|
onnx/encoder_model_q4.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:992218a50dad66c795b13c1cc71541cfef2e98a8e40e627467a22e64b1a7102a
|
3 |
+
size 305349063
|
onnx/encoder_model_q4f16.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3c805036f49c3088ce619f4afe2dfaf3a8c6fd5a31ec6099f11fec415fb47f4c
|
3 |
+
size 190546742
|
onnx/encoder_model_uint8.onnx
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:812dadb73d91873548add060f8a569b7fc07fb93d55e328bacefe0331bc92904
|
3 |
+
size 204472217
|