mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
Override get_vocab for fast tokenizer. (#4717)
This commit is contained in:
parent
88762a2f8c
commit
f6d5046af1
@ -2368,6 +2368,9 @@ class PreTrainedTokenizerFast(PreTrainedTokenizer):
|
||||
def _convert_id_to_token(self, index: int) -> Optional[str]:
|
||||
return self._tokenizer.id_to_token(int(index))
|
||||
|
||||
def get_vocab(self):
|
||||
return self._tokenizer.get_vocab(True)
|
||||
|
||||
def convert_tokens_to_string(self, tokens: List[int], skip_special_tokens: bool = False) -> str:
|
||||
return self._tokenizer.decode(tokens, skip_special_tokens)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user