Skip to content

[model] add Command R7B support - #10685

Open
ojuanjo wants to merge 2 commits into
hiyouga:mainfrom
ojuanjo:feat/cohere2-command-r7b
Open

[model] add Command R7B support#10685
ojuanjo wants to merge 2 commits into
hiyouga:mainfrom
ojuanjo:feat/cohere2-command-r7b

Conversation

@ojuanjo

@ojuanjo ojuanjo commented Jul 27, 2026

Copy link
Copy Markdown

What does this PR do?

Fixes #6338

Adds support for CohereLabs/c4ai-command-r7b-12-2024.

  • Registers CommandR-7B-Chat with Hugging Face and ModelScope download sources.
  • Adds a dedicated cohere2 template without affecting the existing cohere template.
  • Matches the official tokenizer format, including the BOS token, a required system turn, START_RESPONSE, and END_RESPONSE.
  • Adds a standalone unit test and a gated-tokenizer alignment test.

Validation:

  • Passed make style and make quality.
  • Passed the license check.
  • Passed the LLaMA Factory CPU test suite in tests/ and tests_v1/.
  • Verified the cohere2 template against the model's official gated tokenizer.
  • Completed local LLaMA Factory QLoRA SFT and DPO training on an RTX 5080; no training artifacts are included in this PR.

Before submitting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

支持Cohere2架構的c4ai-command-r7b-12-2024

1 participant