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
25de74cc
Unverified
Commit
25de74cc
authored
Jul 29, 2020
by
Sylvain Gugger
Committed by
GitHub
Jul 29, 2020
Browse files
Use FutureWarning to deprecate (#6111)
parent
640550fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
src/transformers/modeling_albert.py
src/transformers/modeling_albert.py
+1
-1
src/transformers/tokenization_utils_base.py
src/transformers/tokenization_utils_base.py
+2
-2
No files found.
src/transformers/modeling_albert.py
View file @
25de74cc
...
...
@@ -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."
,
Deprecation
Warning
,
Future
Warning
,
)
labels
=
kwargs
.
pop
(
"masked_lm_labels"
)
assert
kwargs
==
{},
f
"Unexpected keyword arguments:
{
list
(
kwargs
.
keys
())
}
."
...
...
src/transformers/tokenization_utils_base.py
View file @
25de74cc
...
...
@@ -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)."
,
Deprecation
Warning
,
Future
Warning
,
)
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)."
,
Deprecation
Warning
,
Future
Warning
,
)
truncation_strategy
=
TruncationStrategy
(
old_truncation_strategy
)
elif
truncation
is
not
False
:
...
...
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