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
f3d18c71
Unverified
Commit
f3d18c71
authored
Aug 30, 2019
by
Thomas Wolf
Committed by
GitHub
Aug 30, 2019
Browse files
Merge pull request #1152 from epwalsh/fix-special-tokens
fix adding special tokens
parents
d483cd8e
07e21307
Changes
1
Hide 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 @
f3d18c71
...
...
@@ -784,7 +784,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