MCPcopy Create free account
hub / github.com/zai-org/CodeGeeX / encode

Method encode

codegeex/megatron/tokenizer/gpt2_tokenization.py:318–319  ·  view source on GitHub ↗
(self, text)

Source from the content-addressed store, hash-verified

316 return tokens
317
318 def encode(self, text):
319 return self.convert_tokens_to_ids(self.tokenize(text))
320
321 def decode(self, tokens):
322 text = "".join([self.decoder[token] for token in tokens])

Callers 2

tokenizeMethod · 0.45
tokenizeMethod · 0.45

Calls 2

convert_tokens_to_idsMethod · 0.95
tokenizeMethod · 0.95

Tested by

no test coverage detected