mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-02 19:21:31 +06:00
Merge pull request #2191 from huggingface/fix_sp_np
Numpy compatibility for sentence piece
This commit is contained in:
commit
a557836a70
@ -1227,6 +1227,7 @@ class PreTrainedTokenizer(object):
|
||||
return self._convert_id_to_token(ids)
|
||||
tokens = []
|
||||
for index in ids:
|
||||
index = int(index)
|
||||
if skip_special_tokens and index in self.all_special_ids:
|
||||
continue
|
||||
if index in self.added_tokens_decoder:
|
||||
|
Loading…
Reference in New Issue
Block a user