Remove six.

This commit is contained in:
Aymeric Augustin
2019-12-22 17:56:09 +01:00
parent 6b2200fc88
commit 8af25b1664
19 changed files with 61 additions and 167 deletions

View File

@@ -204,11 +204,11 @@ class CTRLTokenizer(PreTrainedTokenizer):
return split_tokens
def _convert_token_to_id(self, token):
""" Converts a token (str/unicode) in an id using the vocab. """
""" Converts a token (str) in an id using the vocab. """
return self.encoder.get(token, self.encoder.get(self.unk_token))
def _convert_id_to_token(self, index):
"""Converts an index (integer) in a token (string/unicode) using the vocab."""
"""Converts an index (integer) in a token (str) using the vocab."""
return self.decoder.get(index, self.unk_token)
def convert_tokens_to_string(self, tokens):