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

Specify chat template for output model #367

Merged
merged 6 commits into from
Jul 16, 2024
Merged

Specify chat template for output model #367

merged 6 commits into from
Jul 16, 2024

Conversation

cg123
Copy link
Collaborator

@cg123 cg123 commented Jul 15, 2024

Adds a chat_template field to merge configs, which can either be a Jinja template string or one of chatml, llama3, alpaca, mistral. Also supports auto which will try to select the most common template among the input models.

"Failed to copy tokenizer. The merge was still successful, just copy it from somewhere else.",
exc_info=e,
if tokenizer is None:
if options.copy_tokenizer:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

if not model_templates:
return

chat_template = Counter(model_templates).most_common(1)[0][0]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic can be made more robust later but this should be good for now.

@cg123 cg123 merged commit 5fa7782 into main Jul 16, 2024
6 checks passed
@cg123 cg123 deleted the chat_template branch July 16, 2024 01:33
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