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 (8e906d81932247e5ea7bf8063befc45788a68e64)
Co-authored-by: Yuichiro Tachibana <[email protected]>
- README.md +24 -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,28 @@ pipeline_tag: summarization
|
|
| 6 |
|
| 7 |
https://huggingface.co/sshleifer/distilbart-xsum-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-xsum-12-3 with ONNX weights to be compatible with Transformers.js.
|
| 8 |
|
| 9 |
+
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:
|
| 10 |
+
```bash
|
| 11 |
+
npm i @huggingface/transformers
|
| 12 |
+
```
|
| 13 |
+
|
| 14 |
+
**Example:** Summarization.
|
| 15 |
+
|
| 16 |
+
```js
|
| 17 |
+
import { pipeline } from '@huggingface/transformers';
|
| 18 |
+
|
| 19 |
+
const generator = await pipeline('summarization', 'Xenova/distilbart-xsum-12-3');
|
| 20 |
+
const text = 'The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, ' +
|
| 21 |
+
'and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. ' +
|
| 22 |
+
'During its construction, the Eiffel Tower surpassed the Washington Monument to become the tallest ' +
|
| 23 |
+
'man-made structure in the world, a title it held for 41 years until the Chrysler Building in New ' +
|
| 24 |
+
'York City was finished in 1930. It was the first structure to reach a height of 300 metres. Due to ' +
|
| 25 |
+
'the addition of a broadcasting aerial at the top of the tower in 1957, it is now taller than the ' +
|
| 26 |
+
'Chrysler Building by 5.2 metres (17 ft). Excluding transmitters, the Eiffel Tower is the second ' +
|
| 27 |
+
'tallest free-standing structure in France after the Millau Viaduct.';
|
| 28 |
+
const output = await generator(text, {
|
| 29 |
+
max_new_tokens: 100,
|
| 30 |
+
});
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
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:38701134e4fd7006591cd94494c33e8011eecfa98f67f53c0f206ce21b2c84aa
|
| 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:355b2d6e1a9ee75de5905efa023fcfcac1b61be350a1b1bfbce5c76c32412d02
|
| 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:7574d26f56075d190373eb4a6f99cff7c3e9252be34c9720fabb39d5ea907091
|
| 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:208bf48e881c2abbcf61a9e215eb6b9d12c17f68af85aafe005f6945dbc70a04
|
| 3 |
+
size 239140510
|
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:0e61ce090d86d634167e83c481a47b9b09e581683f188f2193447851b8d2d260
|
| 3 |
+
size 206226122
|
onnx/decoder_model_merged_int8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:683c21799578a629ab51530ae6dd88547fbc05acaf606d3657eab446f3dbfd03
|
| 3 |
+
size 103657529
|
onnx/decoder_model_merged_q4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a32697e353c0b4cd67d7bb8edf76fe4fdf3f47945e435a7328d5160606d48278
|
| 3 |
+
size 242285779
|
onnx/decoder_model_merged_q4f16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a211718caa5a49eb02a32b08f02fb9d4c7412d8cd03cc42fe9ca3806d6527c9e
|
| 3 |
+
size 133882143
|
onnx/decoder_model_merged_uint8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:825fd18589a9be35ac7e3f6f84e2a227ba8412f28f496944244382faeac5f5c6
|
| 3 |
+
size 103657541
|
onnx/decoder_model_q4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fd38ec78e7e826c507aaea5a5d3cf8f5e801176fb941f5f18d061060c7ebd3e0
|
| 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:6a8f4003225ca09d489e89953a6a8c9552cab1dee318f6bab2cdfe8147580b2c
|
| 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:3ce21d8f7f146e055033b8df8b260f272703118e0fc9b965503a736b6768d183
|
| 3 |
+
size 103274317
|
onnx/decoder_with_past_model_bnb4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6baacd08989191e995cefd8067f14ea57441ccb695a1829295f3f317ee56e30a
|
| 3 |
+
size 235185007
|
onnx/decoder_with_past_model_fp16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:378490fb8706d31e2aa4dc07083b8f59445e7368c3bb13bc7c01df93f31c89ff
|
| 3 |
+
size 193341963
|
onnx/decoder_with_past_model_int8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b22ece5a9a463a51bec9672ac7491651d5226038161bc1c377804bfd764e729b
|
| 3 |
+
size 96917225
|
onnx/decoder_with_past_model_q4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:611cd257ae8e23cd61681b5f46c29b26cc5007bee1c13fa6103fccf04abf6b3b
|
| 3 |
+
size 237937324
|
onnx/decoder_with_past_model_q4f16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5747db472e32c32c838b399b39f7999b8c32ec60578329ddeffb4a74be7ced45
|
| 3 |
+
size 130037757
|
onnx/decoder_with_past_model_uint8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:335e4fe7622ca7951f3781a8d72376299c2c12b5287f427138c3f462e000ff92
|
| 3 |
+
size 96917234
|
onnx/encoder_model_bnb4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d40e5630221e57e673ea22610f893a75b34021880731372d46c2d1aac6bd913c
|
| 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:d304f1422d1e4a418d028e6fbfea39c5cbef90cceec4e37a5ea704ea1897d04f
|
| 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:b9fd017b3489a8025c10c8d9973f5cf18ec085ab7d2e6b9aa61f7e4b9927fa0b
|
| 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:8bf8d0d2be3ed2027a91840ffe05f73457948da88ee8177ff907549b1a81f52a
|
| 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:9ebe9d46358044e69908239d67ccaae2ebf759cdc1ea4c4f76d9e17406ed46fd
|
| 3 |
+
size 204472217
|