Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use model->gguf_kv for loading the template instead of using the C API. #10868

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

dranger003
Copy link
Contributor

Cohere's command-r models use a rather large chat template and therefore llama_chat_detect_template() fails to properly detect because <|USER_TOKEN|> is beyond the current 2048 limit. This patch bumps the limit to 16K bytes and allows the conversation mode to work with the command-r models.

@slaren
Copy link
Collaborator

slaren commented Dec 17, 2024

This seems too much for something that is called frequently. I would prefer if it skipped the C API and just used model->gguf_kv directly.

@dranger003 dranger003 changed the title Bump model_template to 16384 bytes to support larger chat templates. Use model->gguf_kv for loading the template instead of using the C API. Dec 17, 2024
@slaren slaren merged commit d62b532 into ggerganov:master Dec 17, 2024
48 checks passed
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Dec 20, 2024
…I. (ggerganov#10868)

* Bump model_template to 16384 bytes to support larger chat templates.

* Use `model->gguf_kv` for efficiency.
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.

2 participants