-
Notifications
You must be signed in to change notification settings - Fork 31.4k
MBartForConditionalGeneration #6441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
368ea18 to
5a31182
Compare
|
The failure is coming from |
sshleifer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks suraj!
sgugger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Just left a few doc nits.
docs/source/model_doc/mbart.rst
Outdated
|
|
||
| MBART is a sequence-to-sequence denoising auto-encoder pre-trained on large-scale monolingual corpora in many languages using the BART objective. mBART is one of the first methods for pre-training a complete sequence-to-sequence model by denoising full texts in multiple languages, while previous approaches have focused only on the encoder, decoder, or reconstructing parts of the text. | ||
|
|
||
| The Authors' code can be found `here <https://github.com/pytorch/fairseq/tree/master/examples/mbart>`_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| The Authors' code can be found `here <https://github.com/pytorch/fairseq/tree/master/examples/mbart>`_ | |
| The Authors' code can be found `here <https://github.com/pytorch/fairseq/tree/master/examples/mbart>`__ |
(Using only one _ will cause sphinx to associate every here with that link or complain, so it's best to always use two _)
src/transformers/modeling_mbart.py
Outdated
| MBART_PRETRAINED_MODEL_ARCHIVE_LIST = [ | ||
| "facebook/mbart-large-cc25", | ||
| "facebook/mbart-large-en-ro", | ||
| # See all BART models at https://huggingface.co/models?filter=mbart |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # See all BART models at https://huggingface.co/models?filter=mbart | |
| # See all multilingual BART models at https://huggingface.co/models?filter=mbart |
src/transformers/modeling_mbart.py
Outdated
|
|
||
| MBART_START_DOCSTRING = r""" | ||
| This model is a PyTorch `torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>`_ sub-class. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| This model is a PyTorch `torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>`_ sub-class. | |
| This model is a PyTorch `torch.nn.Module <https://pytorch.org/docs/stable/nn.html#torch.nn.Module>`__ sub-class. |
Codecov Report
@@ Coverage Diff @@
## master #6441 +/- ##
==========================================
+ Coverage 79.77% 80.06% +0.29%
==========================================
Files 148 156 +8
Lines 27214 28024 +810
==========================================
+ Hits 21710 22438 +728
- Misses 5504 5586 +82
Continue to review full report at Codecov.
|
|
Thanks @sgugger , I've applied the suggestions. |
LysandreJik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
| "test_modeling_tf_xlm_roberta.py", | ||
| "test_modeling_xlm_roberta.py", | ||
| "test_modeling_pegasus.py", | ||
| "test_modeling_mbart.py", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking forward to adding this to the common tests!
* Generation doc * MBartForConditionalGeneration (#6441) * add MBartForConditionalGeneration * style * rebase and fixes * add mbart test in TEST_FILES_WITH_NO_COMMON_TESTS * fix docs * don't ignore mbart * doc * fix mbart fairseq link * put mbart before bart * apply doc suggestions * Use hash to clean the test dirs (#6475) * Use hash to clean the test dirs * Use hash to clean the test dirs * Use hash to clean the test dirs * fix * [EncoderDecoder] Add Cross Attention for GPT2 (#6415) * add cross attention layers for gpt2 * make gpt2 cross attention work * finish bert2gpt2 * add explicit comments * remove attention mask since not yet supported * revert attn mask in pipeline * Update src/transformers/modeling_gpt2.py Co-authored-by: Sylvain Gugger <[email protected]> * Update src/transformers/modeling_encoder_decoder.py Co-authored-by: Sylvain Gugger <[email protected]> Co-authored-by: Sylvain Gugger <[email protected]> * Sort unique_no_split_tokens to make it deterministic (#6461) * change unique_no_split_tokens's type to set * use sorted list instead of set * style * Import accuracy_score (#6480) * Apply suggestions from code review Co-authored-by: Lysandre Debut <[email protected]> * Address comments * Styling * Generation doc * Apply suggestions from code review Co-authored-by: Lysandre Debut <[email protected]> * Address comments * Styling Co-authored-by: Suraj Patil <[email protected]> Co-authored-by: Kevin Canwen Xu <[email protected]> Co-authored-by: Patrick von Platen <[email protected]> Co-authored-by: Quentin Lhoest <[email protected]> Co-authored-by: gijswijnholds <[email protected]> Co-authored-by: Lysandre Debut <[email protected]>
This PR adds MBartForConditionalGeneration. Regarding #6416
@sshleifer