Skip to content

Commit 84bcb2c

Browse files
committed
Correct some typo
1 parent d1dbd0c commit 84bcb2c

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

llama_cpp/llama_cpp.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159

160160
# struct llama_vocab;
161161
llama_vocab_p = NewType("llama_vocab_p", int)
162-
llama_vocab_p_ctypes = ctypes.c_int32
162+
llama_vocab_p_ctypes = ctypes.c_void_p
163163

164164
# # struct llama_sampler;
165165
# llama_sampler_p = NewType("llama_sampler_p", int)
@@ -244,7 +244,7 @@
244244
LLAMA_VOCAB_PRE_TYPE_DBRX = 13
245245
LLAMA_VOCAB_PRE_TYPE_SMAUG = 14
246246
LLAMA_VOCAB_PRE_TYPE_PORO = 15
247-
LLAMA_VOCAV_PRE_TYPE_CHATGLM3 = 16
247+
LLAMA_VOCAB_PRE_TYPE_CHATGLM3 = 16
248248
LLAMA_VOCAB_PRE_TYPE_CHATGLM4 = 17
249249
LLAMA_VOCAB_PRE_TYPE_VIKING = 18
250250
LLAMA_VOCAB_PRE_TYPE_JAIS = 19
@@ -1266,12 +1266,6 @@ def llama_n_seq_max(ctx: llama_context_p, /) -> int:
12661266
...
12671267

12681268

1269-
# LLAMA_API int32_t llama_vocab_n_tokens(const struct llama_vocab * vocab);
1270-
@ctypes_function("llama_vocab_n_tokens", [llama_vocab_p_ctypes], ctypes.c_int32)
1271-
def llama_vocab_n_tokens(vocab: llama_vocab_p, /) -> int:
1272-
...
1273-
1274-
12751269
# LLAMA_API int32_t llama_model_n_ctx_train(const struct llama_model * model);
12761270
@ctypes_function("llama_model_n_ctx_train", [llama_model_p_ctypes], ctypes.c_int32)
12771271
def llama_model_n_ctx_train(model: llama_model_p, /) -> int:
@@ -1308,7 +1302,7 @@ def llama_pooling_type(ctx: llama_context_p, /) -> int:
13081302
...
13091303

13101304
# LLAMA_API const struct llama_vocab * llama_model_get_vocab(const struct llama_model * model);
1311-
@ctypes_function("llama_model_get_vocab", [llama_model_p_ctypes], ctypes.c_int32)
1305+
@ctypes_function("llama_model_get_vocab", [llama_model_p_ctypes], llama_vocab_p)
13121306
def llama_model_get_vocab(model: llama_model_p, /) -> Optional[llama_vocab_p]:
13131307
...
13141308

@@ -1330,7 +1324,7 @@ def llama_vocab_type(vocab: llama_vocab_p, /) -> int:
13301324

13311325

13321326
# LLAMA_API int32_t llama_vocab_n_tokens(const struct llama_vocab * vocab);
1333-
@ctypes_function("llama_vocab_n_tokens", [llama_vocab_p_ctypes], ctypes.c_int)
1327+
@ctypes_function("llama_vocab_n_tokens", [llama_vocab_p_ctypes], ctypes.c_int32)
13341328
def llama_vocab_n_tokens(vocab: llama_vocab_p, /) -> int:
13351329
...
13361330

0 commit comments

Comments
 (0)