Revert ctypes argtype change

This commit is contained in:
Andrei Betlen 2023-07-20 18:51:53 -04:00
parent 365d9a4367
commit d10ce62714

View file

@ -175,6 +175,7 @@ llama_progress_callback = ctypes.CFUNCTYPE(None, c_float, c_void_p)
# // context pointer passed to the progress callback
# void * progress_callback_user_data;
# // Keep the booleans together to avoid misalignment during copy-by-value.
# bool low_vram; // if true, reduce VRAM usage at the cost of performance
# bool f16_kv; // use fp16 for KV cache
@ -748,7 +749,12 @@ def llama_get_vocab(
return _lib.llama_get_vocab(ctx, strings, scores, capacity)
_lib.llama_get_vocab.argtypes = [llama_context_p, Array[c_char_p], Array[c_float], c_int]
_lib.llama_get_vocab.argtypes = [
llama_context_p,
POINTER(c_char_p),
POINTER(c_float),
c_int,
]
_lib.llama_get_vocab.restype = c_int
@ -766,6 +772,15 @@ def llama_get_vocab_from_model(
return _lib.llama_get_vocab_from_model(model, strings, scores, capacity)
_lib.llama_get_vocab_from_model.argtypes = [
llama_model_p,
POINTER(c_char_p),
POINTER(c_float),
c_int,
]
_lib.llama_get_vocab_from_model.restype = c_int
# Token logits obtained from the last call to llama_eval()
# The logits for the last token are stored in the last row
# Can be mutated in order to change the probabilities of the next token