MCPcopy Create free account
hub / github.com/THUDM/GLM / _encode

Method _encode

data_utils/tokenization.py:872–875  ·  view source on GitHub ↗
(self, text)

Source from the content-addressed store, hash-verified

870 self._token_type_vocab = {t: Id for Id, t in self.type_id_map.items()}
871
872 def _encode(self, text):
873 tokens = self.text_tokenizer.tokenize(text)
874 ids = self.text_tokenizer.convert_tokens_to_ids(tokens)
875 return ids
876
877 def EncodeAsTokens(self, text, process_fn=None):
878 """convert wordpiece token to Id"""

Callers

nothing calls this directly

Calls 2

tokenizeMethod · 0.45
convert_tokens_to_idsMethod · 0.45

Tested by

no test coverage detected