diff --git a/llama_cpp/llama_cpp.py b/llama_cpp/llama_cpp.py index 5d5b04e..454fe1e 100644 --- a/llama_cpp/llama_cpp.py +++ b/llama_cpp/llama_cpp.py @@ -40,6 +40,7 @@ class llama_token_data(Structure): llama_token_data_p = POINTER(llama_token_data) +llama_progress_callback = ctypes.CFUNCTYPE(None, c_double, c_void_p) class llama_context_params(Structure): _fields_ = [ @@ -54,6 +55,11 @@ class llama_context_params(Structure): ("vocab_only", c_bool), # only load the vocabulary, no weights ("use_mlock", c_bool), # force system to keep model in RAM ("embedding", c_bool), # embedding mode only + + # called with a progress value between 0 and 1, pass NULL to disable + ("progress_callback", llama_progress_callback), + # context pointer passed to the progress callback + ("progress_callback_user_data", c_void_p), ] diff --git a/vendor/llama.cpp b/vendor/llama.cpp index 31572d9..502a400 160000 --- a/vendor/llama.cpp +++ b/vendor/llama.cpp @@ -1 +1 @@ -Subproject commit 31572d966531f7d768eb773322016ab78eb6e835 +Subproject commit 502a400192013d3e95ed87b777e8fa3bec45713c