diff --git a/src/llamafactory/data/template.py b/src/llamafactory/data/template.py index 74faea46..f88d60bb 100644 --- a/src/llamafactory/data/template.py +++ b/src/llamafactory/data/template.py @@ -1684,6 +1684,21 @@ register_template( ) +register_template( + name="smollm", + format_system=StringFormatter( + slots=["<|im_start|>system\n{{content}}<|im_end|>\n"] + ), + format_user=StringFormatter( + slots=["<|im_start|>user\n{{content}}<|im_end|>\n"] + ), + format_assistant=StringFormatter( + slots=["<|im_start|>assistant\n{{content}}<|im_end|>\n"] + ), + stop_words=["<|im_end|>"], +) + + register_template( name="solar", format_user=StringFormatter(slots=["### User:\n{{content}}\n\n### Assistant:\n"]), diff --git a/src/llamafactory/extras/constants.py b/src/llamafactory/extras/constants.py index 5dc7c3f3..b06da885 100644 --- a/src/llamafactory/extras/constants.py +++ b/src/llamafactory/extras/constants.py @@ -2719,6 +2719,25 @@ register_model_group( ) +register_model_group( + models={ + "SmolLM-135M-Instruct": { + DownloadSource.DEFAULT: "HuggingFaceTB/SmolLM-135M-Instruct", + DownloadSource.MODELSCOPE: "HuggingFaceTB/SmolLM-135M-Instruct", + }, + "SmolLM-360M-Instruct": { + DownloadSource.DEFAULT: "HuggingFaceTB/SmolLM-360M-Instruct", + DownloadSource.MODELSCOPE: "HuggingFaceTB/SmolLM-360M-Instruct", + }, + "SmolLM-1.7B-Instruct": { + DownloadSource.DEFAULT: "HuggingFaceTB/SmolLM-1.7B-Instruct", + DownloadSource.MODELSCOPE: "HuggingFaceTB/SmolLM-1.7B-Instruct", + }, + }, + template="smollm", +) + + register_model_group( models={ "SOLAR-10.7B-v1.0": {