Fix generation docstrings regarding input_ids=None (#12823)

This commit is contained in:
Jannis Vamvas 2021-08-18 16:51:54 +02:00 committed by GitHub
parent ecfa7eb260
commit 1fec32adc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 20 deletions

View File

@ -190,7 +190,7 @@ class FlaxGenerationMixin:
Parameters:
input_ids (:obj:`jnp.ndarray` of shape :obj:`(batch_size, sequence_length)`, `optional`):
input_ids (:obj:`jnp.ndarray` of shape :obj:`(batch_size, sequence_length)`):
The sequence used as a prompt for the generation.
max_length (:obj:`int`, `optional`, defaults to 20):
The maximum length of the sequence to be generated.

View File

@ -400,8 +400,8 @@ class TFGenerationMixin:
Parameters:
input_ids (:obj:`tf.Tensor` of :obj:`dtype=tf.int32` and shape :obj:`(batch_size, sequence_length)`, `optional`):
The sequence used as a prompt for the generation. If :obj:`None` the method initializes it as an empty
:obj:`tf.Tensor` of shape :obj:`(1,)`.
The sequence used as a prompt for the generation. If :obj:`None` the method initializes it with
:obj:`bos_token_id` and a batch size of 1.
max_length (:obj:`int`, `optional`, defaults to 20):
The maximum length of the sequence to be generated.
min_length (:obj:`int`, `optional`, defaults to 10):

View File

@ -692,8 +692,8 @@ class GenerationMixin:
Parameters:
input_ids (:obj:`torch.LongTensor` of shape :obj:`(batch_size, sequence_length)`, `optional`):
The sequence used as a prompt for the generation. If :obj:`None` the method initializes it as an empty
:obj:`torch.LongTensor` of shape :obj:`(1,)`.
The sequence used as a prompt for the generation. If :obj:`None` the method initializes it with
:obj:`bos_token_id` and a batch size of 1.
max_length (:obj:`int`, `optional`, defaults to :obj:`model.config.max_length`):
The maximum length of the sequence to be generated.
max_new_tokens (:obj:`int`, `optional`, defaults to None):
@ -1165,9 +1165,8 @@ class GenerationMixin:
Parameters:
input_ids (:obj:`torch.LongTensor` of shape :obj:`(batch_size, sequence_length)`, `optional`):
The sequence used as a prompt for the generation. If :obj:`None` the method initializes it as an empty
:obj:`torch.LongTensor` of shape :obj:`(1,)`.
input_ids (:obj:`torch.LongTensor` of shape :obj:`(batch_size, sequence_length)`):
The sequence used as a prompt for the generation.
logits_processor (:obj:`LogitsProcessorList`, `optional`):
An instance of :class:`~transformers.LogitsProcessorList`. List of instances of class derived from
:class:`~transformers.LogitsProcessor` used to modify the prediction scores of the language modeling
@ -1391,9 +1390,8 @@ class GenerationMixin:
Parameters:
input_ids (:obj:`torch.LongTensor` of shape :obj:`(batch_size, sequence_length)`, `optional`):
The sequence used as a prompt for the generation. If :obj:`None` the method initializes it as an empty
:obj:`torch.LongTensor` of shape :obj:`(1,)`.
input_ids (:obj:`torch.LongTensor` of shape :obj:`(batch_size, sequence_length)`):
The sequence used as a prompt for the generation.
logits_processor (:obj:`LogitsProcessorList`, `optional`):
An instance of :class:`~transformers.LogitsProcessorList`. List of instances of class derived from
:class:`~transformers.LogitsProcessor` used to modify the prediction scores of the language modeling
@ -1632,9 +1630,8 @@ class GenerationMixin:
Parameters:
input_ids (:obj:`torch.LongTensor` of shape :obj:`(batch_size, sequence_length)`, `optional`):
The sequence used as a prompt for the generation. If :obj:`None` the method initializes it as an empty
:obj:`torch.LongTensor` of shape :obj:`(1,)`.
input_ids (:obj:`torch.LongTensor` of shape :obj:`(batch_size, sequence_length)`):
The sequence used as a prompt for the generation.
beam_scorer (:obj:`BeamScorer`):
An derived instance of :class:`~transformers.BeamScorer` that defines how beam hypotheses are
constructed, stored and sorted during generation. For more information, the documentation of
@ -1925,9 +1922,8 @@ class GenerationMixin:
Parameters:
input_ids (:obj:`torch.LongTensor` of shape :obj:`(batch_size, sequence_length)`, `optional`):
The sequence used as a prompt for the generation. If :obj:`None` the method initializes it as an empty
:obj:`torch.LongTensor` of shape :obj:`(1,)`.
input_ids (:obj:`torch.LongTensor` of shape :obj:`(batch_size, sequence_length)`):
The sequence used as a prompt for the generation.
beam_scorer (:obj:`BeamScorer`):
A derived instance of :class:`~transformers.BeamScorer` that defines how beam hypotheses are
constructed, stored and sorted during generation. For more information, the documentation of
@ -2228,9 +2224,8 @@ class GenerationMixin:
Parameters:
input_ids (:obj:`torch.LongTensor` of shape :obj:`(batch_size, sequence_length)`, `optional`):
The sequence used as a prompt for the generation. If :obj:`None` the method initializes it as an empty
:obj:`torch.LongTensor` of shape :obj:`(1,)`.
input_ids (:obj:`torch.LongTensor` of shape :obj:`(batch_size, sequence_length)`):
The sequence used as a prompt for the generation.
beam_scorer (:obj:`BeamScorer`):
An derived instance of :class:`~transformers.BeamScorer` that defines how beam hypotheses are
constructed, stored and sorted during generation. For more information, the documentation of