diff --git a/src/llamafactory/data/template.py b/src/llamafactory/data/template.py index 5160e0c2..ec53b9cf 100644 --- a/src/llamafactory/data/template.py +++ b/src/llamafactory/data/template.py @@ -559,6 +559,15 @@ _register_template( ) +_register_template( + name="cpm3", + format_user=StringFormatter(slots=["<|im_start|>user\n{{content}}<|im_end|>\n<|im_start|>assistant\n"]), + format_prefix=EmptyFormatter(slots=[{"bos_token"}]), + format_system=StringFormatter(slots=["<|im_start|>system\n{{content}}<|im_end|>\n"]), + stop_words=["<|im_end|>"], +) + + _register_template( name="dbrx", format_user=StringFormatter(slots=["<|im_start|>user\n{{content}}<|im_end|>\n<|im_start|>assistant\n"]), diff --git a/src/llamafactory/extras/constants.py b/src/llamafactory/extras/constants.py index 27decebb..9c00cea9 100644 --- a/src/llamafactory/extras/constants.py +++ b/src/llamafactory/extras/constants.py @@ -809,6 +809,17 @@ register_model_group( ) +register_model_group( + models={ + "MiniCPM3-4B": { + DownloadSource.DEFAULT: "openbmb/MiniCPM3-4B", + DownloadSource.MODELSCOPE: "OpenBMB/MiniCPM3-4B", + }, + }, + template="cpm3", +) + + register_model_group( models={ "Mistral-7B-v0.1": {