Skip to content

Commit d10ce62

Browse files
committed
Revert ctypes argtype change
1 parent 365d9a4 commit d10ce62

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

llama_cpp/llama_cpp.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ class llama_token_data_array(Structure):
175175
# // context pointer passed to the progress callback
176176
# void * progress_callback_user_data;
177177

178+
178179
# // Keep the booleans together to avoid misalignment during copy-by-value.
179180
# bool low_vram; // if true, reduce VRAM usage at the cost of performance
180181
# bool f16_kv; // use fp16 for KV cache
@@ -748,7 +749,12 @@ def llama_get_vocab(
748749
return _lib.llama_get_vocab(ctx, strings, scores, capacity)
749750

750751

751-
_lib.llama_get_vocab.argtypes = [llama_context_p, Array[c_char_p], Array[c_float], c_int]
752+
_lib.llama_get_vocab.argtypes = [
753+
llama_context_p,
754+
POINTER(c_char_p),
755+
POINTER(c_float),
756+
c_int,
757+
]
752758
_lib.llama_get_vocab.restype = c_int
753759

754760

@@ -766,6 +772,15 @@ def llama_get_vocab_from_model(
766772
return _lib.llama_get_vocab_from_model(model, strings, scores, capacity)
767773

768774

775+
_lib.llama_get_vocab_from_model.argtypes = [
776+
llama_model_p,
777+
POINTER(c_char_p),
778+
POINTER(c_float),
779+
c_int,
780+
]
781+
_lib.llama_get_vocab_from_model.restype = c_int
782+
783+
769784
# Token logits obtained from the last call to llama_eval()
770785
# The logits for the last token are stored in the last row
771786
# Can be mutated in order to change the probabilities of the next token

0 commit comments

Comments
 (0)