Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/NVIDIA/Megatron-LM
/ encode
Method
encode
tools/preprocess_data_nmt.py:26–30 ·
view source on GitHub ↗
(self, text)
Source
from the content-addressed store, hash-verified
24
Encoder.tokenizer = build_tokenizer(self.args)
25
26
def
encode(self, text):
27
ids = {}
28
ids = Encoder.tokenizer.tokenize(text)
29
assert len(ids) > 0
30
return
ids, len(text)
31
32
33
def
get_args():
Callers
nothing calls this directly
Calls
1
tokenize
Method · 0.45
Tested by
no test coverage detected