vccarvalho11 commited on
Commit
e65f2bc
·
verified ·
1 Parent(s): a581960

Upload bart-large-cnn ONNX model

Browse files
README.md ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: onnx
3
+ tags:
4
+ - text2text-generation
5
+ - bart
6
+ - summarization
7
+ - encoder-decoder
8
+ - onnx
9
+ - inference4j
10
+ license: apache-2.0
11
+ pipeline_tag: summarization
12
+ ---
13
+
14
+ # BART Large CNN — ONNX
15
+
16
+ ONNX export of [BART Large CNN](https://huggingface.co/facebook/bart-large-cnn) (406M parameters) with encoder-decoder architecture and KV cache support.
17
+
18
+ Fine-tuned for text summarization on the CNN/DailyMail dataset.
19
+
20
+ Converted for use with [inference4j](https://github.com/inference4j/inference4j), an inference-only AI library for Java.
21
+
22
+ ## Original Source
23
+
24
+ - **Repository:** [facebook/bart-large-cnn](https://huggingface.co/facebook/bart-large-cnn)
25
+ - **License:** Apache 2.0
26
+
27
+ ## Usage with inference4j
28
+
29
+ ```java
30
+ try (var summarizer = BartSummarizer.bartLargeCnn().build()) {
31
+ System.out.println(summarizer.summarize("Long article text..."));
32
+ }
33
+ ```
34
+
35
+ ## Model Details
36
+
37
+ | Property | Value |
38
+ |----------|-------|
39
+ | Architecture | BART encoder-decoder (406M parameters, 12 encoder + 12 decoder layers) |
40
+ | Task | Text summarization |
41
+ | Training data | CNN/DailyMail |
42
+ | Tokenizer | BPE (50,265 tokens) |
43
+ | Original framework | PyTorch (transformers) |
44
+ | Export method | Hugging Face Optimum (encoder-decoder with KV cache) |
45
+
46
+ ## License
47
+
48
+ This model is licensed under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0). Original model by [Facebook AI](https://huggingface.co/facebook).
config.json ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_num_labels": 3,
3
+ "activation_dropout": 0.0,
4
+ "activation_function": "gelu",
5
+ "add_final_layer_norm": false,
6
+ "architectures": [
7
+ "BartForConditionalGeneration"
8
+ ],
9
+ "attention_dropout": 0.0,
10
+ "bos_token_id": 0,
11
+ "classif_dropout": 0.0,
12
+ "classifier_dropout": 0.0,
13
+ "d_model": 1024,
14
+ "decoder_attention_heads": 16,
15
+ "decoder_ffn_dim": 4096,
16
+ "decoder_layerdrop": 0.0,
17
+ "decoder_layers": 12,
18
+ "decoder_start_token_id": 2,
19
+ "dropout": 0.1,
20
+ "dtype": "float32",
21
+ "early_stopping": null,
22
+ "encoder_attention_heads": 16,
23
+ "encoder_ffn_dim": 4096,
24
+ "encoder_layerdrop": 0.0,
25
+ "encoder_layers": 12,
26
+ "eos_token_id": 2,
27
+ "force_bos_token_to_be_generated": true,
28
+ "forced_eos_token_id": 2,
29
+ "gradient_checkpointing": false,
30
+ "id2label": {
31
+ "0": "LABEL_0",
32
+ "1": "LABEL_1",
33
+ "2": "LABEL_2"
34
+ },
35
+ "init_std": 0.02,
36
+ "is_encoder_decoder": true,
37
+ "label2id": {
38
+ "LABEL_0": 0,
39
+ "LABEL_1": 1,
40
+ "LABEL_2": 2
41
+ },
42
+ "length_penalty": null,
43
+ "max_length": null,
44
+ "max_position_embeddings": 1024,
45
+ "min_length": null,
46
+ "model_type": "bart",
47
+ "no_repeat_ngram_size": null,
48
+ "normalize_before": false,
49
+ "num_beams": null,
50
+ "num_hidden_layers": 12,
51
+ "output_past": true,
52
+ "pad_token_id": 1,
53
+ "prefix": " ",
54
+ "scale_embedding": false,
55
+ "task_specific_params": {
56
+ "summarization": {
57
+ "early_stopping": true,
58
+ "length_penalty": 2.0,
59
+ "max_length": 142,
60
+ "min_length": 56,
61
+ "no_repeat_ngram_size": 3,
62
+ "num_beams": 4
63
+ }
64
+ },
65
+ "transformers_version": "4.57.6",
66
+ "use_cache": true,
67
+ "vocab_size": 50264
68
+ }
decoder_model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ee2f468f76c5cf971baa3c9c7643cdb68eae2b0cfafbca3d4a7521dfda3bd067
3
+ size 1222805764
decoder_with_past_model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bf83b21384c46139c445444747191169a04aa769e1b165004c73c04caac039e2
3
+ size 1122000148
encoder_model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9d4be719088e992b5f18e25a5b10800a6934ae0fc5c67cd5e236e1f4bca61204
3
+ size 814868677
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
vocab.json ADDED
The diff for this file is too large to render. See raw diff