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

Method decode

codegeex/megatron/tokenizer/gpt2_tokenization.py:321–326  ·  view source on GitHub ↗
(self, tokens)

Source from the content-addressed store, hash-verified

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])
323 text = bytearray([self.byte_decoder[c] for c in text]).decode(
324 "utf-8", errors=self.errors
325 )
326 return text
327
328 def save_vocabulary(self, vocab_path):
329 """Save the tokenizer vocabulary and merge files to a directory."""

Callers 2

detokenizeMethod · 0.45
detokenizeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected