Skip to content

Commit

Permalink
Use FutureWarning to deprecate (huggingface#6111)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgugger committed Jul 29, 2020
1 parent 640550f commit 25de74c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/transformers/modeling_albert.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ def forward(
if "masked_lm_labels" in kwargs:
warnings.warn(
"The `masked_lm_labels` argument is deprecated and will be removed in a future version, use `labels` instead.",
DeprecationWarning,
FutureWarning,
)
labels = kwargs.pop("masked_lm_labels")
assert kwargs == {}, f"Unexpected keyword arguments: {list(kwargs.keys())}."
Expand Down
4 changes: 2 additions & 2 deletions src/transformers/tokenization_utils_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1466,7 +1466,7 @@ def _get_padding_truncation_strategies(
"use `padding='max_length'` to pad to a max length. In this case, you can give a specific "
"length with `max_length` (e.g. `max_length=45`) or leave max_length to None to pad to the "
"maximal input size of the model (e.g. 512 for Bert).",
DeprecationWarning,
FutureWarning,
)
if max_length is None:
padding_strategy = PaddingStrategy.LONGEST
Expand All @@ -1492,7 +1492,7 @@ def _get_padding_truncation_strategies(
"`truncation='only_first'` (will only truncate the first sentence in the pairs) "
"`truncation='only_second'` (will only truncate the second sentence in the pairs) "
"or `truncation='longest_first'` (will iteratively remove tokens from the longest sentence in the pairs).",
DeprecationWarning,
FutureWarning,
)
truncation_strategy = TruncationStrategy(old_truncation_strategy)
elif truncation is not False:
Expand Down

0 comments on commit 25de74c

Please sign in to comment.