From 24f39454e91cf5dddbc4b6041aead4accc7c7a2d Mon Sep 17 00:00:00 2001 From: Andrei Betlen Date: Sun, 21 Jan 2024 18:38:04 -0500 Subject: [PATCH] fix: pass chat handler not chat formatter for huggingface autotokenizer and tokenizer_config formats. --- llama_cpp/server/model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llama_cpp/server/model.py b/llama_cpp/server/model.py index c2d6b6d..bbb6806 100644 --- a/llama_cpp/server/model.py +++ b/llama_cpp/server/model.py @@ -78,7 +78,7 @@ class LlamaProxy: settings.hf_pretrained_model_name_or_path is not None ), "hf_pretrained_model_name_or_path must be set for hf-autotokenizer" chat_handler = ( - llama_cpp.llama_chat_format.hf_autotokenizer_to_chat_formatter( + llama_cpp.llama_chat_format.hf_autotokenizer_to_chat_completion_handler( settings.hf_pretrained_model_name_or_path ) ) @@ -87,7 +87,7 @@ class LlamaProxy: settings.hf_tokenizer_config_path is not None ), "hf_tokenizer_config_path must be set for hf-tokenizer-config" chat_handler = ( - llama_cpp.llama_chat_format.hf_tokenizer_config_to_chat_formatter( + llama_cpp.llama_chat_format.hf_tokenizer_config_to_chat_completion_handler( json.load(open(settings.hf_tokenizer_config_path)) ) )