MCPcopy Index your code
hub / github.com/THUDM/GLM / __call__

Method __call__

data_utils/tokenization.py:269–271  ·  view source on GitHub ↗

run preprocessing and encode text as Ids

(self, text, process_fn=None)

Source from the content-addressed store, hash-verified

267 self._token_type_vocab = {t: Id for Id, t in self.type_id_map.items()}
268
269 def __call__(self, text, process_fn=None):
270 """run preprocessing and encode text as Ids"""
271 return self.EncodeAsIds(text, process_fn=process_fn)
272
273 def __len__(self):
274 """total number of tokens"""

Callers

nothing calls this directly

Calls 1

EncodeAsIdsMethod · 0.95

Tested by

no test coverage detected