From 38f6739cd6c1725ecd75a40d5371483f738097c2 Mon Sep 17 00:00:00 2001 From: Suraj Patil Date: Sun, 25 Oct 2020 01:03:47 +0530 Subject: [PATCH] [doc prepare_seq2seq_batch] fix docs (#8013) --- src/transformers/tokenization_bart.py | 2 +- src/transformers/tokenization_utils_base.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/transformers/tokenization_bart.py b/src/transformers/tokenization_bart.py index 47fdb1218b..e7dfc39e78 100644 --- a/src/transformers/tokenization_bart.py +++ b/src/transformers/tokenization_bart.py @@ -122,7 +122,7 @@ class BartTokenizer(RobertaTokenizer): - **attention_mask** -- List of indices specifying which tokens should be attended to by the model. - **labels** -- List of token ids for tgt_texts - The full set of keys ``[input_ids, attention_mask, decoder_input_ids, decoder_attention_mask]``, + The full set of keys ``[input_ids, attention_mask, labels]``, will only be returned if tgt_texts is passed. Otherwise, input_ids, attention_mask will be the only keys. """ kwargs.pop("src_lang", None) diff --git a/src/transformers/tokenization_utils_base.py b/src/transformers/tokenization_utils_base.py index d479186c4b..39a49af535 100644 --- a/src/transformers/tokenization_utils_base.py +++ b/src/transformers/tokenization_utils_base.py @@ -1364,11 +1364,9 @@ PREPARE_SEQ2SEQ_BATCH_DOCSTRING = """ - **input_ids** -- List of token ids to be fed to the encoder. - **attention_mask** -- List of indices specifying which tokens should be attended to by the model. - - **decoder_input_ids** -- List of token ids to be fed to the decoder. - - **decoder_attention_mask** -- List of indices specifying which tokens should be attended to by the decoder. - This does not include causal mask, which is built by the model. + - **labels** -- List of token ids for tgt_texts. - The full set of keys ``[input_ids, attention_mask, decoder_input_ids, decoder_attention_mask]``, + The full set of keys ``[input_ids, attention_mask, labels]``, will only be returned if tgt_texts is passed. Otherwise, input_ids, attention_mask will be the only keys. """