Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d10ce62

Browse filesBrowse files
committed
Revert ctypes argtype change
1 parent 365d9a4 commit d10ce62
Copy full SHA for d10ce62

File tree

Expand file treeCollapse file tree

1 file changed

+16
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+16
-1
lines changed

‎llama_cpp/llama_cpp.py

Copy file name to clipboardExpand all lines: llama_cpp/llama_cpp.py
+16-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.