From c9cd388630c8f12c4735ec55318651ef33e391af 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: 5519a046a24c8403d094c758f044b00f94a7bbbd --- 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 4ed2b629a51ef58d229c795e85238d40346ecb58 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: 9c1bbfac2173450c56ded2cf343e3a37ba369b7b --- 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 8c2b7aa1ab4228662cbfbbfca5ae1579bfb34240 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: 478cbb1aa72f218df37b5a4686db2248ad2605dd --- 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]"]),