MCPcopy Create free account
hub / github.com/NVIDIA/FasterTransformer / decode

Method decode

examples/tensorflow/gpt/utils/gpt_token_encoder.py:141–144  ·  view source on GitHub ↗
(self, tokens)

Source from the content-addressed store, hash-verified

139 return bpe_tokens
140
141 def decode(self, tokens):
142 text = ''.join([self.decoder[token] for token in tokens])
143 text = bytearray([self.byte_decoder[c] for c in text]).decode('utf-8', errors=self.errors)
144 return text
145
146def get_encoder(vocab_file, bpe_file):
147 with open(vocab_file, 'r') as f:

Callers 9

testBothFunction · 0.45
convert_to_unicodeFunction · 0.45
printable_textFunction · 0.45
translateFunction · 0.45
sample_modelFunction · 0.45
convert_tokenFunction · 0.45
preprocess_textFunction · 0.45
encode_piecesFunction · 0.45
translateFunction · 0.45

Calls

no outgoing calls

Tested by 1

testBothFunction · 0.36