MCPcopy Create free account
hub / github.com/OpenSparseLLMs/Linear-MoE / _tokenize

Method _tokenize

linear_moe/tokenizer/tokenization_yi.py:106–108  ·  view source on GitHub ↗

Returns a tokenized string.

(self, text)

Source from the content-addressed store, hash-verified

104 return vocab
105
106 def _tokenize(self, text):
107 """Returns a tokenized string."""
108 return self.sp_model.encode(text, out_type=str)
109
110 def _convert_token_to_id(self, token):
111 """Converts a token (str) in an id using the vocab."""

Callers 1

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected