Class SentencePiece
java.lang.Object
smile.llm.tokenizer.SentencePiece
- All Implemented Interfaces:
Tokenizer
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
SentencePiece
Constructor.- Parameters:
path- The SentencePiece model file path.- Throws:
IOException- if fail to load the model.
-
-
Method Details
-
encode
-
encode
Description copied from interface:TokenizerEncodes a string into a list of token IDs. -
decode
Description copied from interface:TokenizerDecodes a list of token IDs into a string. Note that a token may contain only partial bytes of a character. This method always replaces malformed-input and unmappable-character sequences with this charset's default replacement string. -
tokenize
-