omoral02 commited on
Commit
ca08171
·
verified ·
1 Parent(s): 3fcfc0a

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ pipeline_tag: summarization
5
+ license: mit
6
+ thumbnail: https://huggingface.co/front/thumbnails/facebook.png
7
+ datasets:
8
+ - cnn_dailymail
9
+ model-index:
10
+ - name: facebook/bart-large-cnn
11
+ results:
12
+ - task:
13
+ type: summarization
14
+ name: Summarization
15
+ dataset:
16
+ name: cnn_dailymail
17
+ type: cnn_dailymail
18
+ config: 3.0.0
19
+ split: train
20
+ metrics:
21
+ - name: ROUGE-1
22
+ type: rouge
23
+ value: 42.9486
24
+ verified: true
25
+ - name: ROUGE-2
26
+ type: rouge
27
+ value: 20.8149
28
+ verified: true
29
+ - name: ROUGE-L
30
+ type: rouge
31
+ value: 30.6186
32
+ verified: true
33
+ - name: ROUGE-LSUM
34
+ type: rouge
35
+ value: 40.0376
36
+ verified: true
37
+ - name: loss
38
+ type: loss
39
+ value: 2.529000997543335
40
+ verified: true
41
+ - name: gen_len
42
+ type: gen_len
43
+ value: 78.5866
44
+ verified: true
45
+ library_name: transformers.js
46
+ base_model:
47
+ - facebook/bart-large-cnn
48
+ ---
49
+
50
+
51
+
52
+ # bart-large-cnn (ONNX)
53
+
54
+
55
+ This is an ONNX version of [facebook/bart-large-cnn](https://huggingface.co/facebook/bart-large-cnn). It was automatically converted and uploaded using [this Hugging Face Space](https://huggingface.co/spaces/onnx-community/convert-to-onnx).
56
+
57
+
58
+ ## Usage with Transformers.js
59
+
60
+
61
+ See the pipeline documentation for `summarization`: https://huggingface.co/docs/transformers.js/api/pipelines#module_pipelines.SummarizationPipeline
62
+
63
+
64
+ ---
65
+
66
+
67
+ # BART (large-sized model), fine-tuned on CNN Daily Mail
68
+
69
+ BART model pre-trained on English language, and fine-tuned on [CNN Daily Mail](https://huggingface.co/datasets/cnn_dailymail). It was introduced in the paper [BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension](https://arxiv.org/abs/1910.13461) by Lewis et al. and first released in [this repository (https://github.com/pytorch/fairseq/tree/master/examples/bart).
70
+
71
+ Disclaimer: The team releasing BART did not write a model card for this model so this model card has been written by the Hugging Face team.
72
+
73
+ ## Model description
74
+
75
+ BART is a transformer encoder-encoder (seq2seq) model with a bidirectional (BERT-like) encoder and an autoregressive (GPT-like) decoder. BART is pre-trained by (1) corrupting text with an arbitrary noising function, and (2) learning a model to reconstruct the original text.
76
+
77
+ BART is particularly effective when fine-tuned for text generation (e.g. summarization, translation) but also works well for comprehension tasks (e.g. text classification, question answering). This particular checkpoint has been fine-tuned on CNN Daily Mail, a large collection of text-summary pairs.
78
+
79
+ ## Intended uses & limitations
80
+
81
+ You can use this model for text summarization.
82
+
83
+ ### How to use
84
+
85
+ Here is how to use this model with the [pipeline API](https://huggingface.co/transformers/main_classes/pipelines.html):
86
+
87
+ ```python
88
+ from transformers import pipeline
89
+
90
+ summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
91
+
92
+ ARTICLE = """ New York (CNN)When Liana Barrientos was 23 years old, she got married in Westchester County, New York.
93
+ A year later, she got married again in Westchester County, but to a different man and without divorcing her first husband.
94
+ Only 18 days after that marriage, she got hitched yet again. Then, Barrientos declared "I do" five more times, sometimes only within two weeks of each other.
95
+ In 2010, she married once more, this time in the Bronx. In an application for a marriage license, she stated it was her "first and only" marriage.
96
+ Barrientos, now 39, is facing two criminal counts of "offering a false instrument for filing in the first degree," referring to her false statements on the
97
+ 2010 marriage license application, according to court documents.
98
+ Prosecutors said the marriages were part of an immigration scam.
99
+ On Friday, she pleaded not guilty at State Supreme Court in the Bronx, according to her attorney, Christopher Wright, who declined to comment further.
100
+ After leaving court, Barrientos was arrested and charged with theft of service and criminal trespass for allegedly sneaking into the New York subway through an emergency exit, said Detective
101
+ Annette Markowski, a police spokeswoman. In total, Barrientos has been married 10 times, with nine of her marriages occurring between 1999 and 2002.
102
+ All occurred either in Westchester County, Long Island, New Jersey or the Bronx. She is believed to still be married to four men, and at one time, she was married to eight men at once, prosecutors say.
103
+ Prosecutors said the immigration scam involved some of her husbands, who filed for permanent residence status shortly after the marriages.
104
+ Any divorces happened only after such filings were approved. It was unclear whether any of the men will be prosecuted.
105
+ The case was referred to the Bronx District Attorney\'s Office by Immigration and Customs Enforcement and the Department of Homeland Security\'s
106
+ Investigation Division. Seven of the men are from so-called "red-flagged" countries, including Egypt, Turkey, Georgia, Pakistan and Mali.
107
+ Her eighth husband, Rashid Rajput, was deported in 2006 to his native Pakistan after an investigation by the Joint Terrorism Task Force.
108
+ If convicted, Barrientos faces up to four years in prison. Her next court appearance is scheduled for May 18.
109
+ """
110
+ print(summarizer(ARTICLE, max_length=130, min_length=30, do_sample=False))
111
+ >>> [{'summary_text': 'Liana Barrientos, 39, is charged with two counts of "offering a false instrument for filing in the first degree" In total, she has been married 10 times, with nine of her marriages occurring between 1999 and 2002. She is believed to still be married to four men.'}]
112
+ ```
113
+
114
+ ### BibTeX entry and citation info
115
+
116
+ ```bibtex
117
+ @article{DBLP:journals/corr/abs-1910-13461,
118
+ author = {Mike Lewis and
119
+ Yinhan Liu and
120
+ Naman Goyal and
121
+ Marjan Ghazvininejad and
122
+ Abdelrahman Mohamed and
123
+ Omer Levy and
124
+ Veselin Stoyanov and
125
+ Luke Zettlemoyer},
126
+ title = {{BART:} Denoising Sequence-to-Sequence Pre-training for Natural Language
127
+ Generation, Translation, and Comprehension},
128
+ journal = {CoRR},
129
+ volume = {abs/1910.13461},
130
+ year = {2019},
131
+ url = {http://arxiv.org/abs/1910.13461},
132
+ eprinttype = {arXiv},
133
+ eprint = {1910.13461},
134
+ timestamp = {Thu, 31 Oct 2019 14:02:26 +0100},
135
+ biburl = {https://dblp.org/rec/journals/corr/abs-1910-13461.bib},
136
+ bibsource = {dblp computer science bibliography, https://dblp.org}
137
+ }
138
+ ```
config.json ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_attn_implementation_autoset": true,
3
+ "_name_or_path": "facebook/bart-large-cnn",
4
+ "_num_labels": 3,
5
+ "activation_dropout": 0.0,
6
+ "activation_function": "gelu",
7
+ "add_final_layer_norm": false,
8
+ "architectures": [
9
+ "BartForConditionalGeneration"
10
+ ],
11
+ "attention_dropout": 0.0,
12
+ "bos_token_id": 0,
13
+ "classif_dropout": 0.0,
14
+ "classifier_dropout": 0.0,
15
+ "d_model": 1024,
16
+ "decoder_attention_heads": 16,
17
+ "decoder_ffn_dim": 4096,
18
+ "decoder_layerdrop": 0.0,
19
+ "decoder_layers": 12,
20
+ "decoder_start_token_id": 2,
21
+ "dropout": 0.1,
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
+ "force_bos_token_to_be_generated": true,
29
+ "forced_eos_token_id": 2,
30
+ "gradient_checkpointing": false,
31
+ "id2label": {
32
+ "0": "LABEL_0",
33
+ "1": "LABEL_1",
34
+ "2": "LABEL_2"
35
+ },
36
+ "init_std": 0.02,
37
+ "is_encoder_decoder": true,
38
+ "label2id": {
39
+ "LABEL_0": 0,
40
+ "LABEL_1": 1,
41
+ "LABEL_2": 2
42
+ },
43
+ "length_penalty": null,
44
+ "max_length": null,
45
+ "max_position_embeddings": 1024,
46
+ "min_length": null,
47
+ "model_type": "bart",
48
+ "no_repeat_ngram_size": null,
49
+ "normalize_before": false,
50
+ "num_beams": null,
51
+ "num_hidden_layers": 12,
52
+ "output_past": true,
53
+ "pad_token_id": 1,
54
+ "prefix": " ",
55
+ "scale_embedding": false,
56
+ "task_specific_params": {
57
+ "summarization": {
58
+ "early_stopping": true,
59
+ "length_penalty": 2.0,
60
+ "max_length": 142,
61
+ "min_length": 56,
62
+ "no_repeat_ngram_size": 3,
63
+ "num_beams": 4
64
+ }
65
+ },
66
+ "torch_dtype": "float32",
67
+ "transformers_version": "4.49.0",
68
+ "use_cache": false,
69
+ "vocab_size": 50264
70
+ }
generation_config.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 0,
4
+ "decoder_start_token_id": 2,
5
+ "early_stopping": true,
6
+ "eos_token_id": 2,
7
+ "forced_bos_token_id": 0,
8
+ "forced_eos_token_id": 2,
9
+ "length_penalty": 2.0,
10
+ "max_length": 142,
11
+ "min_length": 56,
12
+ "no_repeat_ngram_size": 3,
13
+ "num_beams": 4,
14
+ "pad_token_id": 1,
15
+ "transformers_version": "4.49.0"
16
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
onnx/decoder_model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:701a25f0e7dcabf73bd1e1d97355113387b91531e05d1287ea7f7dc2319e6a96
3
+ size 1222748378
onnx/decoder_model_bnb4.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3725dc9a5a0a7c1476c8c066698575fa872a7c724148d548459947d3aa76d8a8
3
+ size 353777911
onnx/decoder_model_fp16.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1b897d99719abbf2d49bb3a1977140a8f5d99832b303f2eae7c98f349794a6a7
3
+ size 611642317
onnx/decoder_model_int8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c3e1362a7c44874b504e56d9d594a8a97ecce93335b30901c1aa1fb41ee093e7
3
+ size 307992638
onnx/decoder_model_q4.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1fb36c55e0feffd22ac681d0944c53d01a2dc348411643f2513fc195dc11032b
3
+ size 369576739
onnx/decoder_model_q4f16.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:92f55a952f16da36834a8bd6ff8dc3f646d3f95d6ca816732d6202e9a4831662
3
+ size 248264725
onnx/decoder_model_quantized.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c3e1362a7c44874b504e56d9d594a8a97ecce93335b30901c1aa1fb41ee093e7
3
+ size 307992638
onnx/decoder_model_uint8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e152f7cf9e1bb72b274246cb71bb6b22f39314c07e7754bdb699c56008ca8c07
3
+ size 307992638
onnx/encoder_model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:caca2671d732e6b149c991d0e8c3f24df297288fb2dac2e27173fc9e25ce754d
3
+ size 814949927
onnx/encoder_model_bnb4.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b3660eb821f20089f72c9a005f02b13ce9de9ba2057bc5267eb25d324dea89e1
3
+ size 295916152
onnx/encoder_model_fp16.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:92e60d1057fcb138236dc295e69f1be8c1d5d3abaefedab3dc476f0c41ac2c72
3
+ size 407594903
onnx/encoder_model_int8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4ed925b7ba5501a0b66bf3ad5073dd241c603965e45c672e0ca0be431076ceac
3
+ size 205029246
onnx/encoder_model_q4.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c8dc6c036d98cc61d8c5a3ea2e5ac990d9f5c6f97ce23c602d78755d98a27722
3
+ size 305352748
onnx/encoder_model_q4f16.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fbd916f6b504d99dd3c3445aa42744fa6dc0faab7d50fee148147fae2eb9a3a3
3
+ size 190550427
onnx/encoder_model_quantized.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4ed925b7ba5501a0b66bf3ad5073dd241c603965e45c672e0ca0be431076ceac
3
+ size 205029246
onnx/encoder_model_uint8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:35783f00e83ddda4a8462bb9b108b9ca2a90daf42e8dbd96229cbf2abc5b7a97
3
+ size 205029246
quantize_config.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "modes": [
3
+ "fp16",
4
+ "q8",
5
+ "int8",
6
+ "uint8",
7
+ "q4",
8
+ "q4f16",
9
+ "bnb4"
10
+ ],
11
+ "per_channel": true,
12
+ "reduce_range": true,
13
+ "block_size": null,
14
+ "is_symmetric": true,
15
+ "accuracy_level": null,
16
+ "quant_type": 1,
17
+ "op_block_list": null
18
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "<s>",
3
+ "cls_token": "<s>",
4
+ "eos_token": "</s>",
5
+ "mask_token": {
6
+ "content": "<mask>",
7
+ "lstrip": true,
8
+ "normalized": true,
9
+ "rstrip": false,
10
+ "single_word": false
11
+ },
12
+ "pad_token": "<pad>",
13
+ "sep_token": "</s>",
14
+ "unk_token": "<unk>"
15
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": false,
3
+ "added_tokens_decoder": {
4
+ "0": {
5
+ "content": "<s>",
6
+ "lstrip": false,
7
+ "normalized": true,
8
+ "rstrip": false,
9
+ "single_word": false,
10
+ "special": true
11
+ },
12
+ "1": {
13
+ "content": "<pad>",
14
+ "lstrip": false,
15
+ "normalized": true,
16
+ "rstrip": false,
17
+ "single_word": false,
18
+ "special": true
19
+ },
20
+ "2": {
21
+ "content": "</s>",
22
+ "lstrip": false,
23
+ "normalized": true,
24
+ "rstrip": false,
25
+ "single_word": false,
26
+ "special": true
27
+ },
28
+ "3": {
29
+ "content": "<unk>",
30
+ "lstrip": false,
31
+ "normalized": true,
32
+ "rstrip": false,
33
+ "single_word": false,
34
+ "special": true
35
+ },
36
+ "50264": {
37
+ "content": "<mask>",
38
+ "lstrip": true,
39
+ "normalized": true,
40
+ "rstrip": false,
41
+ "single_word": false,
42
+ "special": true
43
+ }
44
+ },
45
+ "bos_token": "<s>",
46
+ "clean_up_tokenization_spaces": false,
47
+ "cls_token": "<s>",
48
+ "eos_token": "</s>",
49
+ "errors": "replace",
50
+ "extra_special_tokens": {},
51
+ "mask_token": "<mask>",
52
+ "model_max_length": 1000000000000000019884624838656,
53
+ "pad_token": "<pad>",
54
+ "sep_token": "</s>",
55
+ "tokenizer_class": "BartTokenizer",
56
+ "trim_offsets": true,
57
+ "unk_token": "<unk>"
58
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff