"...kernels/git@developer.sourcefind.cn:change/sglang.git" did not exist on "984730b732aa755706bdc269759e1da79862d19e"
Unverified Commit c57e9d94 authored by Thomas Wolf's avatar Thomas Wolf Committed by GitHub
Browse files

Merge branch 'xlnet' into embeddings

parents 2918b7d2 3821ecbf
...@@ -177,11 +177,11 @@ class GPT2Tokenizer(PreTrainedTokenizer): ...@@ -177,11 +177,11 @@ class GPT2Tokenizer(PreTrainedTokenizer):
def _convert_token_to_id(self, token): def _convert_token_to_id(self, token):
""" Converts a token (str/unicode) in an id using the vocab. """ """ Converts a token (str/unicode) in an id using the vocab. """
return self.encoder.get(token, self.encoder.get(self.unk_token)) return self.encoder.get(token)
def _convert_id_to_token(self, index): 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 (string/unicode) using the vocab."""
return self.decoder.get(index, self.unk_token) return self.decoder.get(index)
def _convert_ids_to_string(self, tokens_ids): def _convert_ids_to_string(self, tokens_ids):
"""Converts a sequence of ids in a string.""" """Converts a sequence of ids in a string."""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment