From 08c9607c3d025f9f1a0c40e6d124d5d5d446208e Mon Sep 17 00:00:00 2001 From: Patrick von Platen Date: Fri, 26 Jun 2020 16:58:11 +0200 Subject: [PATCH] [Generation] fix docs for decoder_input_ids (#5306) * fix docs * Update src/transformers/modeling_utils.py * Update src/transformers/modeling_tf_utils.py * Update src/transformers/modeling_tf_utils.py * Update src/transformers/modeling_utils.py * Update src/transformers/modeling_tf_utils.py * Update src/transformers/modeling_utils.py --- src/transformers/modeling_tf_utils.py | 5 +++-- src/transformers/modeling_utils.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/transformers/modeling_tf_utils.py b/src/transformers/modeling_tf_utils.py index 405a7f6555..050589984c 100644 --- a/src/transformers/modeling_tf_utils.py +++ b/src/transformers/modeling_tf_utils.py @@ -642,8 +642,9 @@ class TFPreTrainedModel(tf.keras.Model, TFModelUtilsMixin): `What are attention masks? <../glossary.html#attention-mask>`__ decoder_start_token_id=None: (`optional`) int - If an encoder-decoder model starts decoding with a different token than BOS. - Defaults to `None` and is changed to `BOS` later. + Start token id for the decoder. Defaults to ``decoder_start_token_id`` as defined the model's config or to the ``bos_token_id`` + if no ``decoder_start_token_id`` is found in the config. + This is only relevant for encoder-decoder models. use_cache: (`optional`) bool If `use_cache` is True, past key values are used to speed up decoding if applicable to model. Defaults to `True`. diff --git a/src/transformers/modeling_utils.py b/src/transformers/modeling_utils.py index f1797df96a..015dea5d7e 100644 --- a/src/transformers/modeling_utils.py +++ b/src/transformers/modeling_utils.py @@ -962,8 +962,9 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin): `What are attention masks? <../glossary.html#attention-mask>`__ decoder_start_token_id=None: (`optional`) int - If an encoder-decoder model starts decoding with a different token than BOS. - Defaults to `None` and is changed to `BOS` later. + Start token id for the decoder. Defaults to ``decoder_start_token_id`` as defined the model's config or to the ``bos_token_id`` + if no ``decoder_start_token_id`` is found in the config. + This is only relevant for encoder-decoder models. use_cache: (`optional`) bool If `use_cache` is True, past key values are used to speed up decoding if applicable to model. Defaults to `True`.