diff --git a/llama_cpp/llama_cpp.py b/llama_cpp/llama_cpp.py index d00dfcb..9c8f778 100644 --- a/llama_cpp/llama_cpp.py +++ b/llama_cpp/llama_cpp.py @@ -284,6 +284,27 @@ LLAMA_VOCAB_TYPE_WPM = 3 """BERT tokenizer based on WordPiece""" +# // pre-tokenization types +# enum llama_vocab_pre_type { +# LLAMA_VOCAB_PRE_TYPE_DEFAULT = 0, +# LLAMA_VOCAB_PRE_TYPE_LLAMA3 = 1, +# LLAMA_VOCAB_PRE_TYPE_DEEPSEEK_LLM = 2, +# LLAMA_VOCAB_PRE_TYPE_DEEPSEEK_CODER = 3, +# LLAMA_VOCAB_PRE_TYPE_FALCON = 4, +# LLAMA_VOCAB_PRE_TYPE_MPT = 5, +# LLAMA_VOCAB_PRE_TYPE_STARCODER = 6, +# LLAMA_VOCAB_PRE_TYPE_GPT2 = 7, +# }; +LLAMA_VOCAB_PRE_TYPE_DEFAULT = 0 +LLAMA_VOCAB_PRE_TYPE_LLAMA3 = 1 +LLAMA_VOCAB_PRE_TYPE_DEEPSEEK_LLM = 2 +LLAMA_VOCAB_PRE_TYPE_DEEPSEEK_CODER = 3 +LLAMA_VOCAB_PRE_TYPE_FALCON = 4 +LLAMA_VOCAB_PRE_TYPE_MPT = 5 +LLAMA_VOCAB_PRE_TYPE_STARCODER = 6 +LLAMA_VOCAB_PRE_TYPE_GPT2 = 7 + + # // note: these values should be synchronized with ggml_rope # // TODO: maybe move this enum to ggml.h (ggml_rope_type) # enum llama_rope_type { diff --git a/tests/test_llama.py b/tests/test_llama.py index fa2f6df..469ef91 100644 --- a/tests/test_llama.py +++ b/tests/test_llama.py @@ -6,7 +6,7 @@ from scipy.special import log_softmax import llama_cpp -MODEL = "./vendor/llama.cpp/models/ggml-vocab-llama.gguf" +MODEL = "./vendor/llama.cpp/models/ggml-vocab-llama-spm.gguf" def test_llama_cpp_tokenization(): diff --git a/vendor/llama.cpp b/vendor/llama.cpp index 4dba7e8..8843a98 160000 --- a/vendor/llama.cpp +++ b/vendor/llama.cpp @@ -1 +1 @@ -Subproject commit 4dba7e8114d84241c842b986e008af8b88d1a019 +Subproject commit 8843a98c2ba97a25e93319a104f9ddfaf83ce4c4