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

Improve Mistral/Mixtral instruct prompt #5214

Merged
merged 22 commits into from
Jan 10, 2024

Conversation

BadisG
Copy link
Contributor

@BadisG BadisG commented Jan 9, 2024

Hello.

The mistral instruct prompt is supposed to be this one

<s> [INST] Instruction [/INST] Model answer

Source: https://huggingface.co/mistralai/Mixtral-8x7B-Instruct-v0.1

The original instruct template wasn't accurate enough:
image

Here's the final result with my change:
image

The thing is that this modification isn't really the final version, normally there should be a pair of "INST" for every new instruction

<s> [INST] Instruction [/INST] Model answer</s> [INST] Follow-up instruction [/INST]

It should look like this at the end (If I understood that correctly):
image

I don't know how to do that one, so if you could help me on that part it would be appreciated.

oobabooga and others added 22 commits December 14, 2023 22:39
@oobabooga
Copy link
Owner

That seems correct, thanks. Multiturn is already handled correctly with the template:

 [INST] This is the first message [/INST] This is the first reply</s> [INST] This is the second message [/INST] This is the second reply

print

@oobabooga oobabooga changed the base branch from main to dev January 10, 2024 00:12
@oobabooga oobabooga merged commit c44836c into oobabooga:dev Jan 10, 2024
@Wehzie
Copy link

Wehzie commented Jan 10, 2024

Related to this, why isn't the start of sequence token <s> part of the template?

The Mistral template doesn't use it at all. The LLama-v2 template adds it after the first instruction turn is over with </s>.

PoetOnTheRun pushed a commit to PoetOnTheRun/text-generation-webui that referenced this pull request Feb 22, 2024
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.

None yet

3 participants