From be8b3d8528c6e2cb34f8909e65e5ab420b597edc Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Tue, 20 Aug 2024 16:46:26 -0700 Subject: [PATCH] Phi 3.5 --- README.md | 2 +- unsloth/chat_templates.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b23acffc..0590415f 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ -### Finetune Llama 3.1, Mistral, Phi-3 & Gemma 2-5x faster with 80% less memory! +### Finetune Llama 3.1, Mistral, Phi-3.5 & Gemma 2-5x faster with 80% less memory! ![](https://i.ibb.co/sJ7RhGG/image-41.png) diff --git a/unsloth/chat_templates.py b/unsloth/chat_templates.py index 82f6aba1..f83df579 100644 --- a/unsloth/chat_templates.py +++ b/unsloth/chat_templates.py @@ -473,7 +473,7 @@ # =========================================== Phi-3 phi3_template = \ - "{{ bos_token }}"\ + # "{{ bos_token }}"\ # Phi-3.5 removes BOS? "{% for message in messages %}"\ "{% if message['role'] == 'user' %}"\ "{{'<|user|>\n' + message['content'] + '<|end|>\n'}}"\ @@ -505,7 +505,9 @@ ''' phi3_template_eos_token = "<|end|>" -CHAT_TEMPLATES["phi-3"] = (phi3_template, phi3_template_eos_token, False, phi3_ollama,) +CHAT_TEMPLATES["phi-3"] = (phi3_template, phi3_template_eos_token, False, phi3_ollama,) +CHAT_TEMPLATES["phi-35"] = CHAT_TEMPLATES["phi-3"] +CHAT_TEMPLATES["phi-3.5"] = CHAT_TEMPLATES["phi-3"] pass # =========================================== Llama-3.1