Fix Mistral v0.3 chat template and tokenizer issues #72
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue: Weird repetitive outputs when using the Mistral 7B v0.3 conversational notebook before and after training when using chatml template
The tokenizer was using control token 770 for padding instead of the EOS token, which was messing up training. Also the ShareGPT format wasn't converting properly to what Mistral v0.3 expects.
What I changed:
Made the pad token use EOS instead of the control token
Added manual conversion from ShareGPT to Mistral format as a workaround
Lowered the learning rate so gradients don't explode
The manual format conversion is kinda hacky but works until we figure out why the automatic conversion broke. Probably some update for newer models messed with the older ones.
Other conversational and mistral v0.3 notebooks need to checked for similar issues.