A very simple library containing haskell bindings for Google's sentencepiece C++ library.
import SentencePiece
import Protolude
main = do
processor <- load "/path/to/some/model"
encodedTokens <- encodeStr processor $ fromString "Hello World"
decodedTokens <- decodeStr processor encodedTokens
- Install Nix
- Enable Flakes for Nix
nix build .
nix develop .