MCPcopy
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
33def 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_modeMethod · 0.90

Calls 2

_load_tokenizer_cachedFunction · 0.85
encodeMethod · 0.45

Tested by 2

test_input_ids_modeMethod · 0.72