From f34322afd7d835d111092d8c7b5edddfad28fc13 Mon Sep 17 00:00:00 2001 From: menibrief <66391712+menibrief@users.noreply.github.com> Date: Wed, 18 Sep 2024 23:51:36 +0300 Subject: [PATCH 1/3] Update README.md update readme to phi-small template Former-commit-id: e9df26aa45f916ab0756db3329dff48dcdfce1f1 --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 13ead458..8be45899 100644 --- a/README.md +++ b/README.md @@ -182,7 +182,8 @@ Compared to ChatGLM's [P-Tuning](https://github.com/THUDM/ChatGLM2-6B/tree/main/ | [OLMo](https://huggingface.co/allenai) | 1B/7B | - | | [PaliGemma](https://huggingface.co/google) | 3B | paligemma | | [Phi-1.5/Phi-2](https://huggingface.co/microsoft) | 1.3B/2.7B | - | -| [Phi-3](https://huggingface.co/microsoft) | 4B/7B/14B | phi | +| [Phi-3](https://huggingface.co/microsoft) | 4B/14B | phi | +| [Phi-3-small](https://huggingface.co/microsoft) | 7B | phi-small | | [Qwen/Qwen1.5/Qwen2 (Code/Math/MoE)](https://huggingface.co/Qwen) | 0.5B/1.5B/4B/7B/14B/32B/72B/110B | qwen | | [Qwen2.5 (Code/Math)](https://huggingface.co/Qwen) | 0.5B/1.5B/3B/7B/14B/32B/72B | qwen | | [Qwen2-VL](https://huggingface.co/Qwen) | 2B/7B/72B | qwen2_vl | From a7feab45d5d881ac80145efded82d5ce5061ddfd Mon Sep 17 00:00:00 2001 From: menibrief <66391712+menibrief@users.noreply.github.com> Date: Wed, 18 Sep 2024 23:52:30 +0300 Subject: [PATCH 2/3] fix phi-small template Former-commit-id: 48fb6bae6245dc6d5f72ebfc1c2bd9ffacd51b86 --- src/llamafactory/data/template.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/llamafactory/data/template.py b/src/llamafactory/data/template.py index 54da4757..9490b6af 100644 --- a/src/llamafactory/data/template.py +++ b/src/llamafactory/data/template.py @@ -821,6 +821,15 @@ _register_template( replace_eos=True, ) +_register_template( + name="phi-small", + format_user=StringFormatter(slots=["<|user|>\n{{content}}<|end|>\n<|assistant|>\n"]), + format_system=StringFormatter(slots=["<|system|>\n{{content}}<|end|>\n"]), + format_separator=EmptyFormatter(slots=["\n"]), + format_prefix=EmptyFormatter(slots=[{"<|endoftext|>"}]), + stop_words=["<|end|>"], + replace_eos=True, +) _register_template( name="qwen", From c7c558562e43f9bc6ce16aacb881dedf077828cb Mon Sep 17 00:00:00 2001 From: hoshi-hiyouga Date: Sat, 2 Nov 2024 21:21:22 +0800 Subject: [PATCH 3/3] update template Former-commit-id: 3559ef6115a831dcd1adf7210995ffd62890cff6 --- src/llamafactory/data/template.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/llamafactory/data/template.py b/src/llamafactory/data/template.py index 433b244e..89827f69 100644 --- a/src/llamafactory/data/template.py +++ b/src/llamafactory/data/template.py @@ -941,8 +941,9 @@ _register_template( replace_eos=True, ) + _register_template( - name="phi-small", + name="phi_small", format_user=StringFormatter(slots=["<|user|>\n{{content}}<|end|>\n<|assistant|>\n"]), format_system=StringFormatter(slots=["<|system|>\n{{content}}<|end|>\n"]), format_separator=EmptyFormatter(slots=["\n"]), @@ -951,6 +952,7 @@ _register_template( replace_eos=True, ) + _register_template( name="pixtral", format_user=StringFormatter(slots=["[INST] {{content}} [/INST]"]),