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
b7cdd00f
Unverified
Commit
b7cdd00f
authored
Dec 08, 2020
by
Lysandre Debut
Committed by
GitHub
Dec 08, 2020
Browse files
Fix interaction of return_token_type_ids and add_special_tokens (#8854)
parent
04c446f7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/tokenization_utils_base.py
src/transformers/tokenization_utils_base.py
+1
-1
No files found.
src/transformers/tokenization_utils_base.py
View file @
b7cdd00f
...
...
@@ -2814,7 +2814,7 @@ class PreTrainedTokenizerBase(SpecialTokensMixin):
len_ids
=
len
(
ids
)
len_pair_ids
=
len
(
pair_ids
)
if
pair
else
0
if
return_token_type_ids
is
not
None
and
not
add_special_tokens
:
if
return_token_type_ids
and
not
add_special_tokens
:
raise
ValueError
(
"Asking to return token_type_ids while setting add_special_tokens to False "
"results in an undefined behavior. Please set add_special_tokens to True or "
...
...
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