05-default-pretokenizer.diff 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. From d02a06f3f45a09255ace8684a66590e06ce44605 Mon Sep 17 00:00:00 2001
  2. From: Michael Yang <mxyng@pm.me>
  3. Date: Thu, 23 May 2024 11:33:20 -0700
  4. Subject: [PATCH] default pretokenizer on unrecognized type
  5. ---
  6. llama.cpp | 5 +----
  7. 1 file changed, 1 insertion(+), 4 deletions(-)
  8. diff --git a/llama.cpp b/llama.cpp
  9. index 15c66077..af1aede3 100644
  10. --- a/llama.cpp
  11. +++ b/llama.cpp
  12. @@ -4504,9 +4504,6 @@ static void llm_load_vocab(
  13. LLAMA_LOG_WARN("%s: ************************************ \n", __func__);
  14. LLAMA_LOG_WARN("%s: \n", __func__);
  15. vocab.type_pre = LLAMA_VOCAB_PRE_TYPE_DEFAULT;
  16. - } else if (
  17. - tokenizer_pre == "default") {
  18. - vocab.type_pre = LLAMA_VOCAB_PRE_TYPE_DEFAULT;
  19. } else if (
  20. tokenizer_pre == "llama3" ||
  21. tokenizer_pre == "llama-v3" ||
  22. @@ -4553,7 +4550,7 @@ static void llm_load_vocab(
  23. tokenizer_pre == "dbrx") {
  24. vocab.type_pre = LLAMA_VOCAB_PRE_TYPE_DBRX;
  25. } else {
  26. - throw std::runtime_error(format("unknown pre-tokenizer type: '%s'", tokenizer_pre.c_str()));
  27. + vocab.type_pre = LLAMA_VOCAB_PRE_TYPE_DEFAULT;
  28. }
  29. } else {
  30. vocab.type_pre = LLAMA_VOCAB_PRE_TYPE_DEFAULT;
  31. --
  32. 2.45.1