vccarvalho11 commited on
Commit
61ec627
·
verified ·
1 Parent(s): 945140c

Upload distilbart-cnn-12-6 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
+ # DistilBART CNN 12-6 — ONNX
15
+
16
+ ONNX export of [DistilBART CNN 12-6](https://huggingface.co/sshleifer/distilbart-cnn-12-6) (306M parameters) with encoder-decoder architecture and KV cache support.
17
+
18
+ A distilled version of BART Large CNN, 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:** [sshleifer/distilbart-cnn-12-6](https://huggingface.co/sshleifer/distilbart-cnn-12-6)
25
+ - **License:** Apache 2.0
26
+
27
+ ## Usage with inference4j
28
+
29
+ ```java
30
+ try (var summarizer = BartSummarizer.distilBartCnn().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 (306M parameters, 12 encoder + 6 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 [Sam Shleifer](https://huggingface.co/sshleifer).
config.json ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_num_labels": 3,
3
+ "activation_dropout": 0.0,
4
+ "activation_function": "gelu",
5
+ "add_bias_logits": false,
6
+ "add_final_layer_norm": false,
7
+ "architectures": [
8
+ "BartForConditionalGeneration"
9
+ ],
10
+ "attention_dropout": 0.0,
11
+ "bos_token_id": 0,
12
+ "classif_dropout": 0.0,
13
+ "classifier_dropout": 0.0,
14
+ "d_model": 1024,
15
+ "decoder_attention_heads": 16,
16
+ "decoder_ffn_dim": 4096,
17
+ "decoder_layerdrop": 0.0,
18
+ "decoder_layers": 6,
19
+ "decoder_start_token_id": 2,
20
+ "dropout": 0.1,
21
+ "dtype": "float32",
22
+ "early_stopping": null,
23
+ "encoder_attention_heads": 16,
24
+ "encoder_ffn_dim": 4096,
25
+ "encoder_layerdrop": 0.0,
26
+ "encoder_layers": 12,
27
+ "eos_token_id": 2,
28
+ "extra_pos_embeddings": 2,
29
+ "force_bos_token_to_be_generated": true,
30
+ "forced_eos_token_id": 2,
31
+ "gradient_checkpointing": false,
32
+ "id2label": {
33
+ "0": "LABEL_0",
34
+ "1": "LABEL_1",
35
+ "2": "LABEL_2"
36
+ },
37
+ "init_std": 0.02,
38
+ "is_encoder_decoder": true,
39
+ "label2id": {
40
+ "LABEL_0": 0,
41
+ "LABEL_1": 1,
42
+ "LABEL_2": 2
43
+ },
44
+ "length_penalty": null,
45
+ "max_length": null,
46
+ "max_position_embeddings": 1024,
47
+ "min_length": null,
48
+ "model_type": "bart",
49
+ "no_repeat_ngram_size": null,
50
+ "normalize_before": false,
51
+ "normalize_embedding": true,
52
+ "num_beams": null,
53
+ "num_hidden_layers": 12,
54
+ "output_past": true,
55
+ "pad_token_id": 1,
56
+ "prefix": " ",
57
+ "replacing_rate": 0,
58
+ "scale_embedding": false,
59
+ "static_position_embeddings": false,
60
+ "student_decoder_layers": null,
61
+ "student_encoder_layers": null,
62
+ "task_specific_params": {
63
+ "summarization": {
64
+ "early_stopping": true,
65
+ "length_penalty": 2.0,
66
+ "max_length": 142,
67
+ "min_length": 56,
68
+ "no_repeat_ngram_size": 3,
69
+ "num_beams": 4
70
+ }
71
+ },
72
+ "transformers_version": "4.57.6",
73
+ "use_cache": true,
74
+ "vocab_size": 50264
75
+ }
decoder_model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3d07573868c03d0dc938ca54eee38a3c7855b4d7063c9c277b0f6d3fb761ca98
3
+ size 819503824
decoder_with_past_model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a62480780bafb8b29a6a38d3bc6b5ec5cf444985e0a09d906dafe335e1af7014
3
+ size 769100877
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