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
a557836a
Unverified
Commit
a557836a
authored
Dec 20, 2019
by
Thomas Wolf
Committed by
GitHub
Dec 20, 2019
Browse files
Merge pull request #2191 from huggingface/fix_sp_np
Numpy compatibility for sentence piece
parents
ceae85ad
cb6d54bf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
transformers/tokenization_utils.py
transformers/tokenization_utils.py
+1
-0
No files found.
transformers/tokenization_utils.py
View file @
a557836a
...
@@ -1227,6 +1227,7 @@ class PreTrainedTokenizer(object):
...
@@ -1227,6 +1227,7 @@ class PreTrainedTokenizer(object):
return
self
.
_convert_id_to_token
(
ids
)
return
self
.
_convert_id_to_token
(
ids
)
tokens
=
[]
tokens
=
[]
for
index
in
ids
:
for
index
in
ids
:
index
=
int
(
index
)
if
skip_special_tokens
and
index
in
self
.
all_special_ids
:
if
skip_special_tokens
and
index
in
self
.
all_special_ids
:
continue
continue
if
index
in
self
.
added_tokens_decoder
:
if
index
in
self
.
added_tokens_decoder
:
...
...
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