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

Method EncodeAsTokens

data_utils/tokenization.py:522–527  ·  view source on GitHub ↗

Preprocess text and encode as tokens. Return a tokenization object with original text, processed text, and token tokenization.

(self, text, process_fn=None)

Source from the content-addressed store, hash-verified

520 raise NotImplementedError('TextTokenizer EncodeAsIds not implemented')
521
522 def EncodeAsTokens(self, text, process_fn=None):
523 """
524 Preprocess text and encode as tokens. Return a tokenization object with
525 original text, processed text, and token tokenization.
526 """
527 raise NotImplementedError('TextTokenizer EncodeAsTokens not implemented')
528
529 def IdToToken(self, Id):
530 """Convert an Id to Token. Reverse lookup of self.vocab"""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected