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 (e10fbc9c64d990bf9db9ae8302cef21e0cd22022)
Co-authored-by: Yuichiro Tachibana <[email protected]>
- 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-6 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-6 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-6');
|
| 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:a982a77695d2b4d1e1f3a2765dc58a81f320593e083d90763611d7e89decfdf4
|
| 3 |
+
size 267462255
|
onnx/decoder_model_fp16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:53cc08401a7dafb86c0877b0e1bd7c8de4795f9edac86658a819a0dad993864a
|
| 3 |
+
size 306878508
|
onnx/decoder_model_int8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1335a0ed838a4889ac0256aed4a9a1383491b8e4febeddf57d7e8fa3d83814d1
|
| 3 |
+
size 154003769
|
onnx/decoder_model_merged_bnb4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0f4d7dc9683820b48eda581a29b9d01586cbfe102e836be6c1947cabf03c4ae4
|
| 3 |
+
size 267960723
|
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:e454bbb7cf350c1360585a27c0fed0a00e36b740468a1d96e56acae57c0bad0f
|
| 3 |
+
size 307277399
|
onnx/decoder_model_merged_int8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a67a5677f80fc08686ecce9743c843766efd4aee18ecd971913f22582406e40f
|
| 3 |
+
size 154555843
|
onnx/decoder_model_merged_q4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4181ae320994d0f8c91353d83a4a38a717e7d4012912ef10847d340bcf390d2f
|
| 3 |
+
size 274251262
|
onnx/decoder_model_merged_q4f16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7ef9e8d188175bd4e0002ff95bf834b2d3387808229ae9f921e2d952dc2e16a9
|
| 3 |
+
size 162589439
|
onnx/decoder_model_merged_uint8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a5511fc817eb190bee283d55d5ef83c6a39cb63bf273631c1dceef3815346feb
|
| 3 |
+
size 154555877
|
onnx/decoder_model_q4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:52c74e76fab2f5667a0a7fabe6211794c5f80004b6c2ee86e8f1e487d7206957
|
| 3 |
+
size 273753226
|
onnx/decoder_model_q4f16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:691119b3b00a17fe3a00ced591fd0a3d3831b1b25af64585325b407b7d23c42e
|
| 3 |
+
size 162183948
|
onnx/decoder_model_uint8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:79bbc59d28afa41cb2ffdf963958824df15be65ed0da54b29eca2fd7263bd0fe
|
| 3 |
+
size 154003803
|
onnx/decoder_with_past_model_bnb4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:155b49b6ea0a3bd1ca38b977389c30228d3e74c389d7f315139f4bd8dd55885a
|
| 3 |
+
size 260266846
|
onnx/decoder_with_past_model_fp16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7141a461a330f9139a61c969f0656e08f6318227642ad9df6bcce60bb0a64c17
|
| 3 |
+
size 281626299
|
onnx/decoder_with_past_model_int8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:44438e83054858c8040b0c168c9f75acafc620c57a798dfb95a035f74283e1d0
|
| 3 |
+
size 141293337
|
onnx/decoder_with_past_model_q4.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:50fc46a452de044e2ffe95876be7437441b020a7b83592e9b8476d381058517e
|
| 3 |
+
size 265771480
|
onnx/decoder_with_past_model_q4f16.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2b65e63b485e4be2974cbebb70e624d97b6a0cf6ddc19754ab26875210f7f41e
|
| 3 |
+
size 155017899
|
onnx/decoder_with_past_model_uint8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:189d8c8f8834735d5978c963429216d7e363a10b060431e0eb54a271df4d653d
|
| 3 |
+
size 141293363
|
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
|