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

feat: add Exaone3 chat_template #1995

Merged
merged 2 commits into from
Oct 30, 2024
Merged

Conversation

shing100
Copy link
Contributor

Description

Added exaone template to support new upcoming exaone models

@chiwanpark
Copy link
Contributor

IMHO, there is a patch to load the chat template from model (#1970); thus, we do not need to add the chat template for a specific model.

@shing100
Copy link
Contributor Author

shing100 commented Oct 25, 2024

It's very good.
But is it possible to apply Exaone template to the llama base model without this PR?

@NanoCode012
Copy link
Collaborator

@shing100 , yep! You can see this example:

4. Using a custom jinja template on OpenAI messages format, training on all assistant messages.
```yaml
# chat_template: jinja # `jinja` will be implied if the `chat_template_jinja` is set and this field is empty
chat_template_jinja: "{{ bos_token }}{% for message in messages %}{% if (message['role'] == 'system') %}{{'<|system|>' + '\n' + message['content'] + '<|end|>' + '\n'}}{% elif (message['role'] == 'user') %}{{'<|user|>' + '\n' + message['content'] + '<|end|>' + '\n' + '<|assistant|>' + '\n'}}{% elif message['role'] == 'assistant' %}{{message['content'] + '<|end|>' + '\n'}}{% endif %}{% endfor %}"
datasets:
- path: ...
type: chat_template
roles_to_train: ["assistant"]
```

This way, we don't need to manually merge/add every model's template.

We're currently trying to merge a few PRs soon, and I hope we can get that one in too!

@shing100
Copy link
Contributor Author

@NanoCode012 Thanks!

@shing100 shing100 closed this Oct 25, 2024
@shing100 shing100 reopened this Oct 25, 2024
@NanoCode012
Copy link
Collaborator

@shing100 , I merged #1970 . Please give it a try! I will close this PR for now.

@winglian winglian reopened this Oct 29, 2024
Copy link
Collaborator

@winglian winglian left a comment

Choose a reason for hiding this comment

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

thanks @shing100 !

@shing100
Copy link
Contributor Author

@NanoCode012 @winglian I just saw the message. I reset it again. Thank you!

@winglian winglian merged commit e62554c into axolotl-ai-cloud:main Oct 30, 2024
12 checks passed
bursteratom pushed a commit that referenced this pull request Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants