Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
e7f34ccd
"docs/source/git@developer.sourcefind.cn:norm/vllm.git" did not exist on "9eed4d1f3e012d52059ae28a956b38f34890376a"
Unverified
Commit
e7f34ccd
authored
Mar 09, 2022
by
Joao Gante
Committed by
GitHub
Mar 09, 2022
Browse files
Swag example: Update doc format (#16014)
parent
3ea04699
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
30 deletions
+30
-30
examples/pytorch/multiple-choice/run_swag.py
examples/pytorch/multiple-choice/run_swag.py
+10
-10
examples/pytorch/multiple-choice/run_swag_no_trainer.py
examples/pytorch/multiple-choice/run_swag_no_trainer.py
+10
-10
examples/tensorflow/multiple-choice/run_swag.py
examples/tensorflow/multiple-choice/run_swag.py
+10
-10
No files found.
examples/pytorch/multiple-choice/run_swag.py
View file @
e7f34ccd
...
@@ -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 >=
...
...
examples/pytorch/multiple-choice/run_swag_no_trainer.py
View file @
e7f34ccd
...
@@ -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 >=
...
...
examples/tensorflow/multiple-choice/run_swag.py
View file @
e7f34ccd
...
@@ -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 >=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment