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 c2d1dea

Browse filesBrowse files
committed
Update llama.cpp
1 parent 3674e5e commit c2d1dea
Copy full SHA for c2d1dea

File tree

Expand file treeCollapse file tree

2 files changed

+11
-43
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+11
-43
lines changed

‎llama_cpp/llama_cpp.py

Copy file name to clipboardExpand all lines: llama_cpp/llama_cpp.py
+10-42Lines changed: 10 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,15 @@ def llama_n_embd(ctx: llama_context_p) -> int:
531531
_lib.llama_n_embd.restype = c_int
532532

533533

534+
# LLAMA_API enum llama_vocab_type llama_vocab_type(const struct llama_context * ctx);
535+
def llama_vocab_type(ctx: llama_context_p) -> int:
536+
return _lib.llama_vocab_type(ctx)
537+
538+
539+
_lib.llama_vocab_type.argtypes = [llama_context_p]
540+
_lib.llama_vocab_type.restype = c_int
541+
542+
534543
# LLAMA_API int llama_model_n_vocab(const struct llama_model * model);
535544
def llama_model_n_vocab(model: llama_model_p) -> int:
536545
return _lib.llama_model_n_vocab(model)
@@ -849,7 +858,7 @@ def llama_token_get_score(ctx: llama_context_p, token: llama_token) -> float:
849858
_lib.llama_token_get_score.restype = c_float
850859

851860

852-
# LLAMA_API llama_token_type llama_token_get_type(const struct llama_context * ctx, llama_token token);
861+
# LLAMA_API enum llama_token_type llama_token_get_type(const struct llama_context * ctx, llama_token token);
853862
def llama_token_get_type(ctx: llama_context_p, token: llama_token) -> int:
854863
return _lib.llama_token_get_type(ctx, token)
855864

@@ -918,32 +927,6 @@ def llama_tokenize(
918927
_lib.llama_tokenize.restype = c_int
919928

920929

921-
# LLAMA_API int llama_tokenize_bpe(
922-
# struct llama_context * ctx,
923-
# const char * text,
924-
# llama_token * tokens,
925-
# int n_max_tokens,
926-
# bool add_bos);
927-
def llama_tokenize_bpe(
928-
ctx: llama_context_p,
929-
text: bytes,
930-
tokens, # type: Array[llama_token]
931-
n_max_tokens: c_int,
932-
add_bos: c_bool,
933-
) -> int:
934-
return _lib.llama_tokenize_bpe(ctx, text, tokens, n_max_tokens, add_bos)
935-
936-
937-
_lib.llama_tokenize_bpe.argtypes = [
938-
llama_context_p,
939-
c_char_p,
940-
llama_token_p,
941-
c_int,
942-
c_bool,
943-
]
944-
_lib.llama_tokenize_bpe.restype = c_int
945-
946-
947930
# LLAMA_API int llama_tokenize_with_model(
948931
# const struct llama_model * model,
949932
# const char * text,
@@ -993,21 +976,6 @@ def llama_token_to_str(
993976
_lib.llama_tokenize_with_model.restype = c_int
994977

995978

996-
# LLAMA_API int llama_token_to_str_bpe(
997-
# const struct llama_context * ctx,
998-
# llama_token token,
999-
# char * buf,
1000-
# int length);
1001-
def llama_token_to_str_bpe(
1002-
ctx: llama_context_p, token: llama_token, buf: bytes, length: c_int
1003-
) -> int:
1004-
return _lib.llama_token_to_str_bpe(ctx, token, buf, length)
1005-
1006-
1007-
_lib.llama_token_to_str_bpe.argtypes = [llama_context_p, llama_token, c_char_p, c_int]
1008-
_lib.llama_token_to_str_bpe.restype = c_int
1009-
1010-
1011979
# LLAMA_API int llama_token_to_str_with_model(
1012980
# const struct llama_model * model,
1013981
# llama_token token,

‎vendor/llama.cpp

Copy file name to clipboard

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.