@@ -531,6 +531,15 @@ def llama_n_embd(ctx: llama_context_p) -> int:
531
531
_lib .llama_n_embd .restype = c_int
532
532
533
533
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
+
534
543
# LLAMA_API int llama_model_n_vocab(const struct llama_model * model);
535
544
def llama_model_n_vocab (model : llama_model_p ) -> int :
536
545
return _lib .llama_model_n_vocab (model )
@@ -849,7 +858,7 @@ def llama_token_get_score(ctx: llama_context_p, token: llama_token) -> float:
849
858
_lib .llama_token_get_score .restype = c_float
850
859
851
860
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);
853
862
def llama_token_get_type (ctx : llama_context_p , token : llama_token ) -> int :
854
863
return _lib .llama_token_get_type (ctx , token )
855
864
@@ -918,32 +927,6 @@ def llama_tokenize(
918
927
_lib .llama_tokenize .restype = c_int
919
928
920
929
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
-
947
930
# LLAMA_API int llama_tokenize_with_model(
948
931
# const struct llama_model * model,
949
932
# const char * text,
@@ -993,21 +976,6 @@ def llama_token_to_str(
993
976
_lib .llama_tokenize_with_model .restype = c_int
994
977
995
978
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
-
1011
979
# LLAMA_API int llama_token_to_str_with_model(
1012
980
# const struct llama_model * model,
1013
981
# llama_token token,
0 commit comments