From 781af56f485c0d6b3b33aa71cb34df125e3e7103 Mon Sep 17 00:00:00 2001 From: aswny <87371411+aswny@users.noreply.github.com> Date: Thu, 25 Apr 2024 17:52:38 +0000 Subject: [PATCH] check model type chat/instruct to apply template --- litellm/llms/prompt_templates/factory.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/llms/prompt_templates/factory.py b/litellm/llms/prompt_templates/factory.py index 00c6229c9dd..ed719f600db 100644 --- a/litellm/llms/prompt_templates/factory.py +++ b/litellm/llms/prompt_templates/factory.py @@ -1346,9 +1346,9 @@ def prompt_factory( return anthropic_pt(messages=messages) elif "mistral." in model: return mistral_instruct_pt(messages=messages) - elif "llama2" in model: + elif "llama2" in model and "chat" in model: return llama_2_chat_pt(messages=messages) - elif "llama3" in model: + elif "llama3" in model and "instruct" in model: return hf_chat_template( model=model, messages=messages,