MCPcopy
hub / github.com/ytongbai/LVM / _tokenize

Method _tokenize

EasyLM/models/llama/llama_model.py:1285–1287  ·  view source on GitHub ↗

Returns a tokenized string.

(self, text)

Source from the content-addressed store, hash-verified

1283 return vocab
1284
1285 def _tokenize(self, text):
1286 """Returns a tokenized string."""
1287 return self.sp_model.encode(text, out_type=str)
1288
1289 def _convert_token_to_id(self, token):
1290 """Converts a token (str) in an id using the vocab."""

Callers

nothing calls this directly

Calls 1

encodeMethod · 0.80

Tested by

no test coverage detected