diff --git a/src/llamafactory/data/template.py b/src/llamafactory/data/template.py index 89827f69..27ffe9e8 100644 --- a/src/llamafactory/data/template.py +++ b/src/llamafactory/data/template.py @@ -911,6 +911,19 @@ _register_template( ) +_register_template( + name="opencoder", + format_user=StringFormatter(slots=["<|im_start|>user\n{{content}}<|im_end|>\n<|im_start|>assistant\n"]), + format_system=StringFormatter(slots=["<|im_start|>system\n{{content}}<|im_end|>\n"]), + format_observation=StringFormatter(slots=["<|im_start|>tool\n{{content}}<|im_end|>\n<|im_start|>assistant\n"]), + format_separator=EmptyFormatter(slots=["\n"]), + default_system="You are OpenCoder, created by OpenCoder Team.", + stop_words=["<|im_end|>"], + replace_eos=True, + replace_jinja_template=False, +) + + _register_template( name="orion", format_user=StringFormatter(slots=["Human: {{content}}\n\nAssistant: ", {"eos_token"}]), diff --git a/src/llamafactory/extras/constants.py b/src/llamafactory/extras/constants.py index 8a3ed036..f6738f81 100644 --- a/src/llamafactory/extras/constants.py +++ b/src/llamafactory/extras/constants.py @@ -1105,6 +1105,29 @@ register_model_group( ) +register_model_group( + models={ + "OpenCoder-1.5B-Base": { + DownloadSource.DEFAULT: "infly/OpenCoder-1.5B-Base", + DownloadSource.MODELSCOPE: "infly/OpenCoder-1.5B-Base", + }, + "OpenCoder-8B-Base": { + DownloadSource.DEFAULT: "infly/OpenCoder-8B-Base", + DownloadSource.MODELSCOPE: "infly/OpenCoder-8B-Base", + }, + "OpenCoder-1.5B-Instruct": { + DownloadSource.DEFAULT: "infly/OpenCoder-1.5B-Instruct", + DownloadSource.MODELSCOPE: "infly/OpenCoder-1.5B-Instruct", + }, + "OpenCoder-8B-Instruct": { + DownloadSource.DEFAULT: "infly/OpenCoder-8B-Instruct", + DownloadSource.MODELSCOPE: "infly/OpenCoder-8B-Instruct", + }, + }, + template="opencoder", +) + + register_model_group( models={ "Orion-14B-Base": { @@ -1714,22 +1737,54 @@ register_model_group( DownloadSource.DEFAULT: "Qwen/Qwen2.5-72B-Instruct-AWQ", DownloadSource.MODELSCOPE: "qwen/Qwen2.5-72B-Instruct-AWQ", }, + "Qwen2.5-Coder-0.5B": { + DownloadSource.DEFAULT: "Qwen/Qwen2.5-Coder-0.5B", + DownloadSource.MODELSCOPE: "qwen/Qwen2.5-Coder-0.5B", + }, "Qwen2.5-Coder-1.5B": { DownloadSource.DEFAULT: "Qwen/Qwen2.5-Coder-1.5B", DownloadSource.MODELSCOPE: "qwen/Qwen2.5-Coder-1.5B", }, + "Qwen2.5-Coder-3B": { + DownloadSource.DEFAULT: "Qwen/Qwen2.5-Coder-3B", + DownloadSource.MODELSCOPE: "qwen/Qwen2.5-Coder-3B", + }, "Qwen2.5-Coder-7B": { DownloadSource.DEFAULT: "Qwen/Qwen2.5-Coder-7B", DownloadSource.MODELSCOPE: "qwen/Qwen2.5-Coder-7B", }, + "Qwen2.5-Coder-14B": { + DownloadSource.DEFAULT: "Qwen/Qwen2.5-Coder-14B", + DownloadSource.MODELSCOPE: "qwen/Qwen2.5-Coder-14B", + }, + "Qwen2.5-Coder-32B": { + DownloadSource.DEFAULT: "Qwen/Qwen2.5-Coder-32B", + DownloadSource.MODELSCOPE: "qwen/Qwen2.5-Coder-32B", + }, + "Qwen2.5-Coder-0.5B-Instruct": { + DownloadSource.DEFAULT: "Qwen/Qwen2.5-Coder-0.5B-Instruct", + DownloadSource.MODELSCOPE: "qwen/Qwen2.5-Coder-0.5B-Instruct", + }, "Qwen2.5-Coder-1.5B-Instruct": { DownloadSource.DEFAULT: "Qwen/Qwen2.5-Coder-1.5B-Instruct", DownloadSource.MODELSCOPE: "qwen/Qwen2.5-Coder-1.5B-Instruct", }, + "Qwen2.5-Coder-3B-Instruct": { + DownloadSource.DEFAULT: "Qwen/Qwen2.5-Coder-3B-Instruct", + DownloadSource.MODELSCOPE: "qwen/Qwen2.5-Coder-3B-Instruct", + }, "Qwen2.5-Coder-7B-Instruct": { DownloadSource.DEFAULT: "Qwen/Qwen2.5-Coder-7B-Instruct", DownloadSource.MODELSCOPE: "qwen/Qwen2.5-Coder-7B-Instruct", }, + "Qwen2.5-Coder-14B-Instruct": { + DownloadSource.DEFAULT: "Qwen/Qwen2.5-Coder-14B-Instruct", + DownloadSource.MODELSCOPE: "qwen/Qwen2.5-Coder-14B-Instruct", + }, + "Qwen2.5-Coder-32B-Instruct": { + DownloadSource.DEFAULT: "Qwen/Qwen2.5-Coder-32B-Instruct", + DownloadSource.MODELSCOPE: "qwen/Qwen2.5-Coder-32B-Instruct", + }, "Qwen2.5-Math-1.5B": { DownloadSource.DEFAULT: "Qwen/Qwen2.5-Math-1.5B", DownloadSource.MODELSCOPE: "qwen/Qwen2.5-Math-1.5B",