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

Method tokenize

data_utils/sp_tokenizer.py:117–118  ·  view source on GitHub ↗
(self, text)

Source from the content-addressed store, hash-verified

115 return self.sp.DecodeIds(text)
116
117 def tokenize(self, text):
118 return self.sp.EncodeAsPieces(text)
119
120 def convert_tokens_to_ids(self, tokens):
121 return [self.sp.PieceToId(token) for token in tokens]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected