Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
tokenize
Method · 0.45
tokenize
Method · 0.45
Calls
2
convert_tokens_to_ids
Method · 0.95
tokenize
Method · 0.95
Tested by
no test coverage detected