@@ -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);
535544def 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);
853862def 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,
0 commit comments