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 db982a8

Browse filesBrowse files
committed
Fix
1 parent 4ed632c commit db982a8
Copy full SHA for db982a8

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+16
-7
lines changed

‎llama_cpp/llama_cpp.py

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