From 25de74ccfe51ea31a878cc9e98df37e286768c28 Mon Sep 17 00:00:00 2001 From: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> Date: Wed, 29 Jul 2020 05:20:53 -0400 Subject: [PATCH] Use FutureWarning to deprecate (#6111) --- src/transformers/modeling_albert.py | 2 +- src/transformers/tokenization_utils_base.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/transformers/modeling_albert.py b/src/transformers/modeling_albert.py index f50ce673f2..2f52d1f498 100644 --- a/src/transformers/modeling_albert.py +++ b/src/transformers/modeling_albert.py @@ -823,7 +823,7 @@ class AlbertForMaskedLM(AlbertPreTrainedModel): 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())}." diff --git a/src/transformers/tokenization_utils_base.py b/src/transformers/tokenization_utils_base.py index 63d1351b08..6b424606f7 100644 --- a/src/transformers/tokenization_utils_base.py +++ b/src/transformers/tokenization_utils_base.py @@ -1466,7 +1466,7 @@ class PreTrainedTokenizerBase(SpecialTokensMixin): "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 @@ -1492,7 +1492,7 @@ class PreTrainedTokenizerBase(SpecialTokensMixin): "`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: