diff --git a/README.md b/README.md index 8a895086..5938a270 100644 --- a/README.md +++ b/README.md @@ -194,7 +194,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 | | [Pixtral](https://huggingface.co/mistralai) | 12B | pixtral | | [Qwen (1-2.5) (Code/Math/MoE)](https://huggingface.co/Qwen) | 0.5B/1.5B/3B/7B/14B/32B/72B/110B | qwen | | [Qwen2-VL](https://huggingface.co/Qwen) | 2B/7B/72B | qwen2_vl | diff --git a/src/llamafactory/data/template.py b/src/llamafactory/data/template.py index 18ac2ed5..89827f69 100644 --- a/src/llamafactory/data/template.py +++ b/src/llamafactory/data/template.py @@ -942,6 +942,17 @@ _register_template( ) +_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="pixtral", format_user=StringFormatter(slots=["[INST] {{content}} [/INST]"]),