LLM: fix llm pybinding (#8509)
This commit is contained in:
parent
fcc352eee3
commit
86b5938075
2 changed files with 6 additions and 4 deletions
|
|
@ -54,6 +54,7 @@ from ctypes import (
|
|||
c_char_p,
|
||||
c_void_p,
|
||||
c_bool,
|
||||
pointer,
|
||||
POINTER,
|
||||
_Pointer, # type: ignore
|
||||
Structure,
|
||||
|
|
@ -230,10 +231,10 @@ _lib.gptneox_mlock_supported.restype = c_bool
|
|||
def gptneox_init_from_file(
|
||||
path_model: bytes, params: gptneox_context_params
|
||||
) -> gptneox_context_p:
|
||||
return _lib.gptneox_init_from_file(path_model, params)
|
||||
return _lib.gptneox_init_from_file(path_model, pointer(params))
|
||||
|
||||
|
||||
_lib.gptneox_init_from_file.argtypes = [c_char_p, gptneox_context_params]
|
||||
_lib.gptneox_init_from_file.argtypes = [c_char_p, gptneox_context_params_p]
|
||||
_lib.gptneox_init_from_file.restype = gptneox_context_p
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ from ctypes import (
|
|||
c_char_p,
|
||||
c_void_p,
|
||||
c_bool,
|
||||
pointer,
|
||||
POINTER,
|
||||
_Pointer, # type: ignore
|
||||
Structure,
|
||||
|
|
@ -307,10 +308,10 @@ _lib.llama_time_us.restype = ctypes.c_int64
|
|||
def llama_init_from_file(
|
||||
path_model: bytes, params: llama_context_params
|
||||
) -> llama_context_p:
|
||||
return _lib.llama_init_from_file(path_model, params)
|
||||
return _lib.llama_init_from_file(path_model, pointer(params))
|
||||
|
||||
|
||||
_lib.llama_init_from_file.argtypes = [c_char_p, llama_context_params]
|
||||
_lib.llama_init_from_file.argtypes = [c_char_p, llama_context_params_p]
|
||||
_lib.llama_init_from_file.restype = llama_context_p
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue