Compare commits
No commits in common. "cb48c1365bd826bd521f650dc2e0940aee54720c" and "78e492d5ce79656b22d33734a3d6c2feff564e71" have entirely different histories.
cb48c1365b
...
78e492d5ce
|
@ -6,4 +6,3 @@
|
||||||
*.tar.gz filter=lfs diff=lfs merge=lfs -text
|
*.tar.gz filter=lfs diff=lfs merge=lfs -text
|
||||||
*.ot filter=lfs diff=lfs merge=lfs -text
|
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||||
*.onnx filter=lfs diff=lfs merge=lfs -text
|
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||||
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
|
||||||
|
|
62
README.md
62
README.md
|
@ -1,62 +0,0 @@
|
||||||
---
|
|
||||||
license: apache-2.0
|
|
||||||
language: en
|
|
||||||
---
|
|
||||||
|
|
||||||
# BART (large-sized model)
|
|
||||||
|
|
||||||
BART model pre-trained on English language. 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).
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
## Model description
|
|
||||||
|
|
||||||
BART is a transformer encoder-decoder (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.
|
|
||||||
|
|
||||||
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).
|
|
||||||
|
|
||||||
## Intended uses & limitations
|
|
||||||
|
|
||||||
You can use the raw model for text infilling. However, the model is mostly meant to be fine-tuned on a supervised dataset. See the [model hub](https://huggingface.co/models?search=bart) to look for fine-tuned versions on a task that interests you.
|
|
||||||
|
|
||||||
### How to use
|
|
||||||
|
|
||||||
Here is how to use this model in PyTorch:
|
|
||||||
|
|
||||||
```python
|
|
||||||
from transformers import BartTokenizer, BartModel
|
|
||||||
|
|
||||||
tokenizer = BartTokenizer.from_pretrained('facebook/bart-large')
|
|
||||||
model = BartModel.from_pretrained('facebook/bart-large')
|
|
||||||
|
|
||||||
inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
|
|
||||||
outputs = model(**inputs)
|
|
||||||
|
|
||||||
last_hidden_states = outputs.last_hidden_state
|
|
||||||
```
|
|
||||||
|
|
||||||
### BibTeX entry and citation info
|
|
||||||
|
|
||||||
```bibtex
|
|
||||||
@article{DBLP:journals/corr/abs-1910-13461,
|
|
||||||
author = {Mike Lewis and
|
|
||||||
Yinhan Liu and
|
|
||||||
Naman Goyal and
|
|
||||||
Marjan Ghazvininejad and
|
|
||||||
Abdelrahman Mohamed and
|
|
||||||
Omer Levy and
|
|
||||||
Veselin Stoyanov and
|
|
||||||
Luke Zettlemoyer},
|
|
||||||
title = {{BART:} Denoising Sequence-to-Sequence Pre-training for Natural Language
|
|
||||||
Generation, Translation, and Comprehension},
|
|
||||||
journal = {CoRR},
|
|
||||||
volume = {abs/1910.13461},
|
|
||||||
year = {2019},
|
|
||||||
url = {http://arxiv.org/abs/1910.13461},
|
|
||||||
eprinttype = {arXiv},
|
|
||||||
eprint = {1910.13461},
|
|
||||||
timestamp = {Thu, 31 Oct 2019 14:02:26 +0100},
|
|
||||||
biburl = {https://dblp.org/rec/journals/corr/abs-1910-13461.bib},
|
|
||||||
bibsource = {dblp computer science bibliography, https://dblp.org}
|
|
||||||
}
|
|
||||||
```
|
|
37
config.json
37
config.json
|
@ -1,15 +1,16 @@
|
||||||
{
|
{
|
||||||
"activation_dropout": 0.1,
|
"_num_labels": 3,
|
||||||
|
"activation_dropout": 0.0,
|
||||||
"activation_function": "gelu",
|
"activation_function": "gelu",
|
||||||
"add_bias_logits": false,
|
|
||||||
"add_final_layer_norm": false,
|
"add_final_layer_norm": false,
|
||||||
"architectures": [
|
"architectures": [
|
||||||
"BartModel"
|
"BartModel",
|
||||||
|
"BartForMaskedLM",
|
||||||
|
"BartForSequenceClassification"
|
||||||
],
|
],
|
||||||
"attention_dropout": 0.1,
|
"attention_dropout": 0.0,
|
||||||
"bos_token_id": 0,
|
"bos_token_id": 0,
|
||||||
"classif_dropout": 0.1,
|
"classif_dropout": 0.0,
|
||||||
"classifier_dropout": 0.0,
|
|
||||||
"d_model": 1024,
|
"d_model": 1024,
|
||||||
"decoder_attention_heads": 16,
|
"decoder_attention_heads": 16,
|
||||||
"decoder_ffn_dim": 4096,
|
"decoder_ffn_dim": 4096,
|
||||||
|
@ -17,15 +18,11 @@
|
||||||
"decoder_layers": 12,
|
"decoder_layers": 12,
|
||||||
"decoder_start_token_id": 2,
|
"decoder_start_token_id": 2,
|
||||||
"dropout": 0.1,
|
"dropout": 0.1,
|
||||||
"early_stopping": true,
|
|
||||||
"encoder_attention_heads": 16,
|
"encoder_attention_heads": 16,
|
||||||
"encoder_ffn_dim": 4096,
|
"encoder_ffn_dim": 4096,
|
||||||
"encoder_layerdrop": 0.0,
|
"encoder_layerdrop": 0.0,
|
||||||
"encoder_layers": 12,
|
"encoder_layers": 12,
|
||||||
"eos_token_id": 2,
|
"eos_token_id": 2,
|
||||||
"forced_eos_token_id": 2,
|
|
||||||
"forced_bos_token_id": 0,
|
|
||||||
"gradient_checkpointing": false,
|
|
||||||
"id2label": {
|
"id2label": {
|
||||||
"0": "LABEL_0",
|
"0": "LABEL_0",
|
||||||
"1": "LABEL_1",
|
"1": "LABEL_1",
|
||||||
|
@ -40,33 +37,21 @@
|
||||||
},
|
},
|
||||||
"max_position_embeddings": 1024,
|
"max_position_embeddings": 1024,
|
||||||
"model_type": "bart",
|
"model_type": "bart",
|
||||||
"no_repeat_ngram_size": 3,
|
|
||||||
"normalize_before": false,
|
"normalize_before": false,
|
||||||
"num_beams": 4,
|
|
||||||
"num_hidden_layers": 12,
|
"num_hidden_layers": 12,
|
||||||
|
"output_past": false,
|
||||||
"pad_token_id": 1,
|
"pad_token_id": 1,
|
||||||
|
"prefix": " ",
|
||||||
"scale_embedding": false,
|
"scale_embedding": false,
|
||||||
"task_specific_params": {
|
"task_specific_params": {
|
||||||
"summarization": {
|
"summarization": {
|
||||||
"length_penalty": 1.0,
|
"early_stopping": true,
|
||||||
"max_length": 128,
|
|
||||||
"min_length": 12,
|
|
||||||
"num_beams": 4
|
|
||||||
},
|
|
||||||
"summarization_cnn": {
|
|
||||||
"length_penalty": 2.0,
|
"length_penalty": 2.0,
|
||||||
"max_length": 142,
|
"max_length": 142,
|
||||||
"min_length": 56,
|
"min_length": 56,
|
||||||
|
"no_repeat_ngram_size": 3,
|
||||||
"num_beams": 4
|
"num_beams": 4
|
||||||
},
|
|
||||||
"summarization_xsum": {
|
|
||||||
"length_penalty": 1.0,
|
|
||||||
"max_length": 62,
|
|
||||||
"min_length": 11,
|
|
||||||
"num_beams": 6
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"transformers_version": "4.7.0.dev0",
|
|
||||||
"use_cache": true,
|
|
||||||
"vocab_size": 50265
|
"vocab_size": 50265
|
||||||
}
|
}
|
||||||
|
|
BIN
flax_model.msgpack (Stored with Git LFS)
BIN
flax_model.msgpack (Stored with Git LFS)
Binary file not shown.
BIN
pytorch_model.bin (Stored with Git LFS)
BIN
pytorch_model.bin (Stored with Git LFS)
Binary file not shown.
BIN
tf_model.h5 (Stored with Git LFS)
BIN
tf_model.h5 (Stored with Git LFS)
Binary file not shown.
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
||||||
{"model_max_length": 1024}
|
|
Loading…
Reference in New Issue