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

Fixing/Adding Mistral Templates #1927

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pandora-s-git
Copy link

Description

This PR has come objective fixing the templates and making them match as closesly as possible the ground truth (Mistral Common), a document delves into details this issue here.

Motivation and Context

This PR should make the templates match properly the corresponding tokenizer of mistral models, it does not tackle function calling but the basic instruction template. It is possible to use the hugging face templates if function calling is supported by Axolotl.
The previous template was not correct, and only matched partially the expected format, this format that will be used assumes that the BOS is not added by default, since im new to Axolotl feel free to confirm this is the proper way to do it!

How has this been tested?

I did not test heavily since I am aware this templates are correct, the only possible issue would depend on how Axolotl implements it, and I may lack the insights confirm it will work out of the box and match perfectly, my main 2 concerns are:

  • does Axolotl add a BOS by default? If yes I can remove the BOS from the template.
  • does Axolotl also do generation/inference? If yes its important to note the model with this template will always start with a token with a leading white space for the V1, V2 and V3 tokenizers (not the Tekken).

The current templates will format it as such:

V1

<s> [INST] Hello [/INST] Hi there!</s> [INST] How are you? [/INST] I am good, thanks!</s>

V2

<s>[INST] Hello[/INST] Hi there!</s>[INST] How are you?[/INST] I am good, thanks!</s>

V3-Tekken

<s>[INST]Hello[/INST]Hi there!</s>[INST]How are you?[/INST]I am good, thanks!</s>

Types of changes

Simple Jinja templates.

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.

1 participant