tokenize

suspend fun tokenize(text: String, addSpecial: Boolean = false, parseSpecial: Boolean = false): IntArray(source)

Tokenizes UTF-8 text with the model's vocabulary.

Parameters

addSpecial

add BOS/EOS as the model requires.

parseSpecial

parse control tokens written as text.