From 1a27406426947a51e968922605b6f6b51f63ee00 Mon Sep 17 00:00:00 2001 From: Xuan Son Nguyen Date: Sat, 10 Feb 2024 00:11:13 +0100 Subject: [PATCH] server: clean up using_chatml variable Co-authored-by: Jared Van Bortel --- examples/server/oai.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/server/oai.hpp b/examples/server/oai.hpp index 2199df237..2eca8a9fb 100644 --- a/examples/server/oai.hpp +++ b/examples/server/oai.hpp @@ -19,8 +19,7 @@ inline static json oaicompat_completion_params_parse( const std::string &chat_template) { json llama_params; - bool using_chatml = chat_template == "chatml"; - std::string formatted_prompt = using_chatml + std::string formatted_prompt = chat_template == "chatml" ? format_chatml(body["messages"]) // OpenAI 'messages' to chatml (with <|im_start|>,...) : format_llama2(body["messages"]); // OpenAI 'messages' to llama2 (with [INST],...)