module Llama.Internal.Foreign.Decode (
c_llama_batch_get_one_into
, c_llama_batch_init_into
, c_llama_batch_free_wrap
, c_llama_encode
, c_llama_decode_wrap
, c_llama_set_n_threads
, c_llama_n_threads
, c_llama_n_threads_batch
, c_llama_set_embeddings
, c_llama_set_causal_attn
, c_llama_set_warmup
, c_llama_set_abort_callback
, c_llama_synchronize
, c_llama_get_logits
, c_llama_get_logits_ith
, c_llama_get_embeddings
, c_llama_get_embeddings_ith
, c_llama_get_embeddings_seq
) where
import Foreign
import Foreign.C
import Llama.Internal.Types
foreign import ccall "llama_batch_get_one_into"
c_llama_batch_get_one_into ::
Ptr LlamaToken ->
CInt ->
Ptr LlamaBatch ->
IO ()
foreign import ccall "llama_batch_init_into"
c_llama_batch_init_into ::
CInt ->
CInt ->
CInt ->
Ptr LlamaBatch ->
IO ()
foreign import ccall "llama_batch_free_wrap"
c_llama_batch_free_wrap :: Ptr LlamaBatch -> IO ()
foreign import ccall "llama_encode"
c_llama_encode ::
CLlamaContext ->
Ptr LlamaBatch ->
IO CInt
foreign import ccall "llama_decode_wrap"
c_llama_decode_wrap ::
CLlamaContext ->
Ptr LlamaBatch ->
IO CInt
foreign import ccall "llama_set_n_threads"
c_llama_set_n_threads ::
CLlamaContext ->
CInt ->
CInt ->
IO ()
foreign import ccall "llama_n_threads"
c_llama_n_threads ::
CLlamaContext ->
IO CInt
foreign import ccall "llama_n_threads_batch"
c_llama_n_threads_batch ::
CLlamaContext ->
IO CInt
foreign import ccall "llama_set_embeddings"
c_llama_set_embeddings ::
CLlamaContext ->
CBool ->
IO ()
foreign import ccall "llama_set_causal_attn"
c_llama_set_causal_attn ::
CLlamaContext ->
CBool ->
IO ()
foreign import ccall "llama_set_warmup"
c_llama_set_warmup ::
CLlamaContext ->
CBool ->
IO ()
foreign import ccall "llama_set_abort_callback"
c_llama_set_abort_callback ::
CLlamaContext ->
FunPtr (Ptr () -> IO CInt) ->
Ptr () ->
IO ()
foreign import ccall "llama_synchronize"
c_llama_synchronize ::
CLlamaContext ->
IO ()
foreign import ccall "llama_get_logits"
c_llama_get_logits ::
CLlamaContext ->
IO (Ptr CFloat)
foreign import ccall "llama_get_logits_ith"
c_llama_get_logits_ith ::
CLlamaContext ->
CInt ->
IO (Ptr CFloat)
foreign import ccall "llama_get_embeddings"
c_llama_get_embeddings ::
CLlamaContext ->
IO (Ptr CFloat)
foreign import ccall "llama_get_embeddings_ith"
c_llama_get_embeddings_ith ::
CLlamaContext ->
CInt ->
IO (Ptr CFloat)
foreign import ccall "llama_get_embeddings_seq"
c_llama_get_embeddings_seq ::
CLlamaContext ->
LlamaSeqId ->
IO (Ptr CFloat)