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

Method DecodeTokens

data_utils/tokenization.py:1265–1270  ·  view source on GitHub ↗
(self, Tokens, type_token=False)

Source from the content-addressed store, hash-verified

1263 return text
1264
1265 def DecodeTokens(self, Tokens, type_token=False):
1266 if type_token:
1267 return ' '.join(t.token if isinstance(t, TypeToken) else t for t in Tokens)
1268 if isinstance(Tokens, Tokenization):
1269 Tokens = Tokens.tokenization
1270 return self.text_tokenizer.decode([self.TokenToId(tok) for tok in Tokens])

Callers

nothing calls this directly

Calls 2

TokenToIdMethod · 0.95
decodeMethod · 0.45

Tested by

no test coverage detected