Skip to content

Commit

Permalink
Format.
Browse files Browse the repository at this point in the history
Signed-off-by: Morgan Funtowicz <funtowiczmo@gmail.com>
  • Loading branch information
mfuntowicz authored and thomwolf committed Jun 25, 2020
1 parent a3b2114 commit 1179cc8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/transformers/tokenization_utils.py
Expand Up @@ -667,10 +667,7 @@ def _prepare_for_model(
# Manage padding as multiple of provided integer
if pad_to_multiple_of is not None:
if self.pad_token is None:
logger.warning(
"No padding token set, pad_to_multiple_of=%d will not be used",
pad_to_multiple_of
)
logger.warning("No padding token set, pad_to_multiple_of=%d will not be used", pad_to_multiple_of)
else:
target_length = ((total_len // pad_to_multiple_of) + 1) * pad_to_multiple_of

Expand Down
4 changes: 2 additions & 2 deletions src/transformers/tokenization_utils_fast.py
Expand Up @@ -322,7 +322,7 @@ def _batch_encode_plus(
"Overriding padding_strategy from %s to %s as required by pad_to_multiple_of=%d",
padding_strategy.name,
PaddingStrategy.MAX_LENGTH.name,
pad_to_multiple_of
pad_to_multiple_of,
)

padding_strategy = PaddingStrategy.MAX_LENGTH
Expand All @@ -333,7 +333,7 @@ def _batch_encode_plus(
truncation_strategy=truncation_strategy,
max_length=max_length,
stride=stride,
pad_to_multiple_of=pad_to_multiple_of
pad_to_multiple_of=pad_to_multiple_of,
)

# Avoid thread overhead if only one example.
Expand Down

0 comments on commit 1179cc8

Please sign in to comment.