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
07e21307
Commit
07e21307
authored
Aug 29, 2019
by
epwalsh
Browse files
fix adding special tokens
parent
caf1d116
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
pytorch_transformers/tokenization_utils.py
pytorch_transformers/tokenization_utils.py
+1
-1
No files found.
pytorch_transformers/tokenization_utils.py
View file @
07e21307
...
...
@@ -676,7 +676,7 @@ class PreTrainedTokenizer(object):
all_toks
=
[]
set_attr
=
self
.
special_tokens_map
for
attr_value
in
set_attr
.
values
():
all_toks
=
all_toks
+
(
attr_value
if
isinstance
(
attr_value
,
(
list
,
tuple
))
else
[
attr_value
])
all_toks
=
all_toks
+
(
list
(
attr_value
)
if
isinstance
(
attr_value
,
(
list
,
tuple
))
else
[
attr_value
])
all_toks
=
list
(
set
(
all_toks
))
return
all_toks
...
...
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