"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "4fb3d3a0f6f0da95548a5e6bd02850d468c85e32"
Unverified Commit e7f34ccd authored by Joao Gante's avatar Joao Gante Committed by GitHub
Browse files

Swag example: Update doc format (#16014)

parent 3ea04699
...@@ -152,21 +152,21 @@ class DataCollatorForMultipleChoice: ...@@ -152,21 +152,21 @@ class DataCollatorForMultipleChoice:
Data collator that will dynamically pad the inputs for multiple choice received. Data collator that will dynamically pad the inputs for multiple choice received.
Args: Args:
tokenizer (:class:`~transformers.PreTrainedTokenizer` or :class:`~transformers.PreTrainedTokenizerFast`): tokenizer ([`PreTrainedTokenizer`] or [`PreTrainedTokenizerFast`]):
The tokenizer used for encoding the data. The tokenizer used for encoding the data.
padding (:obj:`bool`, :obj:`str` or :class:`~transformers.file_utils.PaddingStrategy`, `optional`, defaults to :obj:`True`): padding (`bool`, `str` or [`~file_utils.PaddingStrategy`], *optional*, defaults to `True`):
Select a strategy to pad the returned sequences (according to the model's padding side and padding index) Select a strategy to pad the returned sequences (according to the model's padding side and padding index)
among: among:
* :obj:`True` or :obj:`'longest'`: Pad to the longest sequence in the batch (or no padding if only a single - `True` or `'longest'`: Pad to the longest sequence in the batch (or no padding if only a single sequence
sequence if provided). if provided).
* :obj:`'max_length'`: Pad to a maximum length specified with the argument :obj:`max_length` or to the - `'max_length'`: Pad to a maximum length specified with the argument `max_length` or to the maximum
maximum acceptable input length for the model if that argument is not provided. acceptable input length for the model if that argument is not provided.
* :obj:`False` or :obj:`'do_not_pad'` (default): No padding (i.e., can output a batch with sequences of - `False` or `'do_not_pad'` (default): No padding (i.e., can output a batch with sequences of different
different lengths). lengths).
max_length (:obj:`int`, `optional`): max_length (`int`, *optional*):
Maximum length of the returned list and optionally padding length (see above). Maximum length of the returned list and optionally padding length (see above).
pad_to_multiple_of (:obj:`int`, `optional`): pad_to_multiple_of (`int`, *optional*):
If set will pad the sequence to a multiple of the provided value. If set will pad the sequence to a multiple of the provided value.
This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability >= This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability >=
......
...@@ -191,21 +191,21 @@ class DataCollatorForMultipleChoice: ...@@ -191,21 +191,21 @@ class DataCollatorForMultipleChoice:
Data collator that will dynamically pad the inputs for multiple choice received. Data collator that will dynamically pad the inputs for multiple choice received.
Args: Args:
tokenizer (:class:`~transformers.PreTrainedTokenizer` or :class:`~transformers.PreTrainedTokenizerFast`): tokenizer ([`PreTrainedTokenizer`] or [`PreTrainedTokenizerFast`]):
The tokenizer used for encoding the data. The tokenizer used for encoding the data.
padding (:obj:`bool`, :obj:`str` or :class:`~transformers.file_utils.PaddingStrategy`, `optional`, defaults to :obj:`True`): padding (`bool`, `str` or [`~file_utils.PaddingStrategy`], *optional*, defaults to `True`):
Select a strategy to pad the returned sequences (according to the model's padding side and padding index) Select a strategy to pad the returned sequences (according to the model's padding side and padding index)
among: among:
* :obj:`True` or :obj:`'longest'`: Pad to the longest sequence in the batch (or no padding if only a single - `True` or `'longest'`: Pad to the longest sequence in the batch (or no padding if only a single sequence
sequence if provided). if provided).
* :obj:`'max_length'`: Pad to a maximum length specified with the argument :obj:`max_length` or to the - `'max_length'`: Pad to a maximum length specified with the argument `max_length` or to the maximum
maximum acceptable input length for the model if that argument is not provided. acceptable input length for the model if that argument is not provided.
* :obj:`False` or :obj:`'do_not_pad'` (default): No padding (i.e., can output a batch with sequences of - `False` or `'do_not_pad'` (default): No padding (i.e., can output a batch with sequences of different
different lengths). lengths).
max_length (:obj:`int`, `optional`): max_length (`int`, *optional*):
Maximum length of the returned list and optionally padding length (see above). Maximum length of the returned list and optionally padding length (see above).
pad_to_multiple_of (:obj:`int`, `optional`): pad_to_multiple_of (`int`, *optional*):
If set will pad the sequence to a multiple of the provided value. If set will pad the sequence to a multiple of the provided value.
This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability >= This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability >=
......
...@@ -73,21 +73,21 @@ class DataCollatorForMultipleChoice: ...@@ -73,21 +73,21 @@ class DataCollatorForMultipleChoice:
Data collator that will dynamically pad the inputs for multiple choice received. Data collator that will dynamically pad the inputs for multiple choice received.
Args: Args:
tokenizer (:class:`~transformers.PreTrainedTokenizer` or :class:`~transformers.PreTrainedTokenizerFast`): tokenizer ([`PreTrainedTokenizer`] or [`PreTrainedTokenizerFast`]):
The tokenizer used for encoding the data. The tokenizer used for encoding the data.
padding (:obj:`bool`, :obj:`str` or :class:`~transformers.file_utils.PaddingStrategy`, `optional`, defaults to :obj:`True`): padding (`bool`, `str` or [`~file_utils.PaddingStrategy`], *optional*, defaults to `True`):
Select a strategy to pad the returned sequences (according to the model's padding side and padding index) Select a strategy to pad the returned sequences (according to the model's padding side and padding index)
among: among:
* :obj:`True` or :obj:`'longest'`: Pad to the longest sequence in the batch (or no padding if only a single - `True` or `'longest'`: Pad to the longest sequence in the batch (or no padding if only a single sequence
sequence if provided). if provided).
* :obj:`'max_length'`: Pad to a maximum length specified with the argument :obj:`max_length` or to the - `'max_length'`: Pad to a maximum length specified with the argument `max_length` or to the maximum
maximum acceptable input length for the model if that argument is not provided. acceptable input length for the model if that argument is not provided.
* :obj:`False` or :obj:`'do_not_pad'` (default): No padding (i.e., can output a batch with sequences of - `False` or `'do_not_pad'` (default): No padding (i.e., can output a batch with sequences of different
different lengths). lengths).
max_length (:obj:`int`, `optional`): max_length (`int`, *optional*):
Maximum length of the returned list and optionally padding length (see above). Maximum length of the returned list and optionally padding length (see above).
pad_to_multiple_of (:obj:`int`, `optional`): pad_to_multiple_of (`int`, *optional*):
If set will pad the sequence to a multiple of the provided value. If set will pad the sequence to a multiple of the provided value.
This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability >= This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability >=
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment