From cb7912ee7415e98fcc5289acdaa37e49619bd241 Mon Sep 17 00:00:00 2001 From: ochafik Date: Sun, 29 Sep 2024 00:33:19 +0100 Subject: [PATCH] `chat-template`: add phi-3.5-vision-instruct --- .../goldens/microsoft-Phi-3.5-vision-instruct-simple.txt | 4 ++++ .../goldens/microsoft-Phi-3.5-vision-instruct-system.txt | 6 ++++++ .../templates/microsoft-Phi-3.5-vision-instruct.jinja | 4 ++++ tests/update_jinja_goldens.py | 9 +-------- 4 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 tests/chat/goldens/microsoft-Phi-3.5-vision-instruct-simple.txt create mode 100644 tests/chat/goldens/microsoft-Phi-3.5-vision-instruct-system.txt create mode 100644 tests/chat/templates/microsoft-Phi-3.5-vision-instruct.jinja diff --git a/tests/chat/goldens/microsoft-Phi-3.5-vision-instruct-simple.txt b/tests/chat/goldens/microsoft-Phi-3.5-vision-instruct-simple.txt new file mode 100644 index 000000000..3f0e5ca78 --- /dev/null +++ b/tests/chat/goldens/microsoft-Phi-3.5-vision-instruct-simple.txt @@ -0,0 +1,4 @@ +<|user|> +What's your favourite LLM framework?<|end|> +<|assistant|> +llama.cpp!<|end|> diff --git a/tests/chat/goldens/microsoft-Phi-3.5-vision-instruct-system.txt b/tests/chat/goldens/microsoft-Phi-3.5-vision-instruct-system.txt new file mode 100644 index 000000000..7a7730176 --- /dev/null +++ b/tests/chat/goldens/microsoft-Phi-3.5-vision-instruct-system.txt @@ -0,0 +1,6 @@ +<|system|> +You only tell the truth.<|end|> +<|user|> +What's your favourite LLM framework?<|end|> +<|assistant|> +llama.cpp!<|end|> diff --git a/tests/chat/templates/microsoft-Phi-3.5-vision-instruct.jinja b/tests/chat/templates/microsoft-Phi-3.5-vision-instruct.jinja new file mode 100644 index 000000000..76ed59a56 --- /dev/null +++ b/tests/chat/templates/microsoft-Phi-3.5-vision-instruct.jinja @@ -0,0 +1,4 @@ +{% for message in messages %}{{'<|' + message['role'] + '|>' + ' +' + message['content'] + '<|end|> +' }}{% endfor %}{% if add_generation_prompt and messages[-1]['role'] != 'assistant' %}{{- '<|assistant|> +' -}}{% endif %} \ No newline at end of file diff --git a/tests/update_jinja_goldens.py b/tests/update_jinja_goldens.py index 0f1527123..16f9c904b 100644 --- a/tests/update_jinja_goldens.py +++ b/tests/update_jinja_goldens.py @@ -42,6 +42,7 @@ model_ids = [ "microsoft/Phi-3-mini-4k-instruct", "microsoft/Phi-3-small-8k-instruct", "microsoft/Phi-3.5-mini-instruct", + "microsoft/Phi-3.5-vision-instruct", "mlabonne/AlphaMonarch-7B", "CohereForAI/c4ai-command-r-plus", "NousResearch/Hermes-2-Pro-Llama-3-8B", @@ -56,14 +57,6 @@ model_ids = [ "teknium/OpenHermes-2.5-Mistral-7B", "TheBloke/FusionNet_34Bx2_MoE-AWQ", - # C++ minja templating broken: - # "THUDM/chatglm3-6b", - # "derek33125/project-angel-chatglm4", - - # Cannot find chat template: - # "eachadea/vicuna-13b-1.1", - # "microsoft/Phi-3-vision-instruct", - # Gated models: "meta-llama/Llama-3.2-3B-Instruct", "meta-llama/Meta-Llama-3.1-8B-Instruct",