llama-cpp-hs
Safe HaskellNone
LanguageHaskell2010

Llama.Internal.Foreign.Tokenize

Synopsis

Documentation

c_llama_tokenize :: CLlamaVocab -> CString -> CInt -> Ptr LlamaToken -> CInt -> CBool -> CBool -> IO CInt Source #

LLAMA_API int32_t llama_tokenize( | const struct llama_vocab * vocab, | const char * text, | int32_t text_len, | llama_token * tokens, | int32_t n_tokens_max, | bool add_special, | bool parse_special);

c_llama_token_to_piece :: CLlamaVocab -> LlamaToken -> CString -> CInt -> CInt -> CBool -> IO CInt Source #

LLAMA_API int32_t llama_token_to_piece( | const struct llama_vocab * vocab, | llama_token token, | char * buf, | int32_t length, | int32_t lstrip, | bool special);

c_llama_detokenize :: CLlamaVocab -> Ptr LlamaToken -> CInt -> CString -> CInt -> CBool -> CBool -> IO CInt Source #

LLAMA_API int32_t llama_detokenize( | const struct llama_vocab * vocab, | const llama_token * tokens, | int32_t n_tokens, | char * text, | int32_t text_len_max, | bool remove_special, | bool unparse_special);