From c970d41a85381fd55235136f123422df0bf0c7e7 Mon Sep 17 00:00:00 2001 From: Andrei Betlen Date: Wed, 24 Jan 2024 10:38:30 -0500 Subject: [PATCH] fix: llama_log_set should be able to accept null pointer --- llama_cpp/llama_cpp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llama_cpp/llama_cpp.py b/llama_cpp/llama_cpp.py index 5de837f..d31a5da 100644 --- a/llama_cpp/llama_cpp.py +++ b/llama_cpp/llama_cpp.py @@ -2528,7 +2528,7 @@ _lib.llama_print_system_info.restype = c_char_p # // If this is not called, or NULL is supplied, everything is output on stderr. # LLAMA_API void llama_log_set(ggml_log_callback log_callback, void * user_data); def llama_log_set( - log_callback: "ctypes._FuncPointer", user_data: c_void_p # type: ignore + log_callback: Union["ctypes._FuncPointer", c_void_p], user_data: c_void_p # type: ignore ): """Set callback for all future logging events. @@ -2536,7 +2536,7 @@ def llama_log_set( return _lib.llama_log_set(log_callback, user_data) -_lib.llama_log_set.argtypes = [llama_log_callback, c_void_p] +_lib.llama_log_set.argtypes = [ctypes.c_void_p, c_void_p] _lib.llama_log_set.restype = None