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

Method DecodeTokens

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

Source from the content-addressed store, hash-verified

1127 return self.text_tokenizer.decode(Ids)
1128
1129 def DecodeTokens(self, Tokens, type_token=False):
1130 if type_token:
1131 return ' '.join(t.token if isinstance(t, TypeToken) else t for t in Tokens)
1132 if isinstance(Tokens, Tokenization):
1133 Tokens = Tokens.tokenization
1134 return self.text_tokenizer.decode([self.TokenToId(tok) for tok in Tokens])
1135
1136
1137class ChineseSPTokenizer(Tokenizer):

Callers

nothing calls this directly

Calls 2

TokenToIdMethod · 0.95
decodeMethod · 0.45

Tested by

no test coverage detected