Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/InternLM/lmdeploy
/ encode_text
Function
encode_text
autotest/utils/toolkit.py:33–38 ·
view source on GitHub ↗
(model_path: str, text: str)
Source
from the content-addressed store, hash-verified
31
32
33
def
encode_text(model_path: str, text: str) -> list[int]:
34
tokenizer = _load_tokenizer_cached(model_path)
35
36
encoded = tokenizer.encode(text)
37
38
return
encoded
Callers
2
test_input_ids_mode
Method · 0.90
test_input_ids_with_logprob
Method · 0.90
Calls
2
_load_tokenizer_cached
Function · 0.85
encode
Method · 0.45
Tested by
2
test_input_ids_mode
Method · 0.72
test_input_ids_with_logprob
Method · 0.72