Skip to content

Commit db982a8

Browse files
committed
Fix
1 parent 4ed632c commit db982a8

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

llama_cpp/llama_cpp.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,15 +1008,24 @@ def llama_token_to_str_bpe(
10081008
_lib.llama_token_to_str_bpe.restype = c_int
10091009

10101010

1011-
# LLAMA_API const char * llama_token_to_str_with_model(
1012-
# const struct llama_model * model,
1013-
# llama_token token);
1014-
def llama_token_to_str_with_model(model: llama_model_p, token: llama_token) -> bytes:
1015-
return _lib.llama_token_to_str_with_model(model, token)
1011+
# LLAMA_API int llama_token_to_str_with_model(
1012+
# const struct llama_model * model,
1013+
# llama_token token,
1014+
# char * buf,
1015+
# int length);
1016+
def llama_token_to_str_with_model(
1017+
model: llama_model_p, token: llama_token, buf: bytes, length: c_int
1018+
) -> int:
1019+
return _lib.llama_token_to_str_with_model(model, token, buf, length)
10161020

10171021

1018-
_lib.llama_token_to_str_with_model.argtypes = [llama_model_p, llama_token]
1019-
_lib.llama_token_to_str_with_model.restype = c_char_p
1022+
_lib.llama_token_to_str_with_model.argtypes = [
1023+
llama_model_p,
1024+
llama_token,
1025+
c_char_p,
1026+
c_int,
1027+
]
1028+
_lib.llama_token_to_str_with_model.restype = c_int
10201029

10211030

10221031
# //

0 commit comments

Comments
 (0)