diff --git a/src/llmtuner/data/template.py b/src/llmtuner/data/template.py index 52358c1e..7a1f4ab8 100644 --- a/src/llmtuner/data/template.py +++ b/src/llmtuner/data/template.py @@ -526,6 +526,21 @@ _register_template( ) +_register_template( + name="cohere", + format_user=StringFormatter( + slots=[ + ( + "<|START_OF_TURN_TOKEN|><|USER_TOKEN|>{{content}}<|END_OF_TURN_TOKEN|>" + "<|START_OF_TURN_TOKEN|><|CHATBOT_TOKEN|>" + ) + ] + ), + format_system=EmptyFormatter(slots=[{"bos_token"}]), + force_system=True, +) + + _register_template( name="cpm", format_user=StringFormatter(slots=["<用户>{{content}}"]), diff --git a/src/llmtuner/extras/constants.py b/src/llmtuner/extras/constants.py index 729e0fa6..321c36a4 100644 --- a/src/llmtuner/extras/constants.py +++ b/src/llmtuner/extras/constants.py @@ -242,6 +242,28 @@ register_model_group( ) +register_model_group( + models={ + "CommandR-35B-Chat": { + DownloadSource.DEFAULT: "CohereForAI/c4ai-command-r-v01", + DownloadSource.MODELSCOPE: "AI-ModelScope/c4ai-command-r-v01", + }, + "CommandR-Plus-104B-Chat": { + DownloadSource.DEFAULT: "CohereForAI/c4ai-command-r-plus", + DownloadSource.MODELSCOPE: "AI-ModelScope/c4ai-command-r-plus", + }, + "CommandR-35B-4bit-Chat": { + DownloadSource.DEFAULT: "CohereForAI/c4ai-command-r-v01-4bit", + DownloadSource.MODELSCOPE: "mirror013/c4ai-command-r-v01-4bit", + }, + "CommandR-Plus-104B-4bit-Chat": { + DownloadSource.DEFAULT: "CohereForAI/c4ai-command-r-plus-4bit", + }, + }, + template="cohere", +) + + register_model_group( models={ "DeepSeek-LLM-7B-Base": {