Fix ctypes definitions of llama_kv_cache_view_update and llama_kv_cache_view_free. (#1028)

This commit is contained in:
Eduard Christian Dumitrescu 2023-12-18 18:11:26 -05:00 committed by GitHub
parent 5e863d8a3b
commit 2993936b10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1041,6 +1041,9 @@ class llama_kv_cache_view(Structure):
] ]
llama_kv_cache_view_p = POINTER(llama_kv_cache_view)
# // Create an empty KV cache view. (use only for debugging purposes) # // Create an empty KV cache view. (use only for debugging purposes)
# LLAMA_API struct llama_kv_cache_view llama_kv_cache_view_init(const struct llama_context * ctx, int32_t n_max_seq); # LLAMA_API struct llama_kv_cache_view llama_kv_cache_view_init(const struct llama_context * ctx, int32_t n_max_seq);
def llama_kv_cache_view_init( def llama_kv_cache_view_init(
@ -1056,23 +1059,23 @@ _lib.llama_kv_cache_view_init.restype = llama_kv_cache_view
# // Free a KV cache view. (use only for debugging purposes) # // Free a KV cache view. (use only for debugging purposes)
# LLAMA_API void llama_kv_cache_view_free(struct llama_kv_cache_view * view); # LLAMA_API void llama_kv_cache_view_free(struct llama_kv_cache_view * view);
def llama_kv_cache_view_free(view: llama_kv_cache_view): def llama_kv_cache_view_free(view: llama_kv_cache_view_p):
"""Free a KV cache view. (use only for debugging purposes)""" """Free a KV cache view. (use only for debugging purposes)"""
return _lib.llama_kv_cache_view_free(view) return _lib.llama_kv_cache_view_free(view)
_lib.llama_kv_cache_view_free.argtypes = [llama_kv_cache_view] _lib.llama_kv_cache_view_free.argtypes = [llama_kv_cache_view_p]
_lib.llama_kv_cache_view_free.restype = None _lib.llama_kv_cache_view_free.restype = None
# // Update the KV cache view structure with the current state of the KV cache. (use only for debugging purposes) # // Update the KV cache view structure with the current state of the KV cache. (use only for debugging purposes)
# LLAMA_API void llama_kv_cache_view_update(const struct llama_context * ctx, struct llama_kv_cache_view * view); # LLAMA_API void llama_kv_cache_view_update(const struct llama_context * ctx, struct llama_kv_cache_view * view);
def llama_kv_cache_view_update(ctx: llama_context_p, view: llama_kv_cache_view): def llama_kv_cache_view_update(ctx: llama_context_p, view: llama_kv_cache_view_p):
"""Update the KV cache view structure with the current state of the KV cache. (use only for debugging purposes)""" """Update the KV cache view structure with the current state of the KV cache. (use only for debugging purposes)"""
return _lib.llama_kv_cache_view_update(ctx, view) return _lib.llama_kv_cache_view_update(ctx, view)
_lib.llama_kv_cache_view_update.argtypes = [llama_context_p, llama_kv_cache_view] _lib.llama_kv_cache_view_update.argtypes = [llama_context_p, llama_kv_cache_view_p]
_lib.llama_kv_cache_view_update.restype = None _lib.llama_kv_cache_view_update.restype = None