-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Added mistral instruct chat format as "mistral-instruct" #799
Added mistral instruct chat format as "mistral-instruct" #799
Conversation
Did you checked - does it (llama.cpp nowadays tokenizer) even tokenize text correctly? Because from what I found at https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.1-GGUF - prompt format is:
And inside prompt_tokens: List[int] = (
self.tokenize(prompt.encode("utf-8"))
if prompt != ""
else [self.token_bos()]
) While I tried the following code: for token in model.tokenize("<s>[INST] Test prompt [/INST]".encode(), add_bos=False):
print(model.detokenize([token])) And the output was:
I guess So I am asking just in case I missed something and this stuff should work already. |
I have not checked that deep. Is this model dependent, or something that would need to be implemented on llama.cpp? I've quickly looked on open issues there and found these: ggerganov/llama.cpp#3475 But at least on mistral model with my changes it works a bit better than just using the llama-2 prompt. |
8c93cf8
to
cc0fe43
Compare
Hi can we merge this? |
Based on this document, I believe this pull request is accurate for a single round. However, according to the document, for multiple rounds of history, each round should conclude with '< /s >'. |
Hi @abetlen might it be possible to merge this, now that Mistral Instruct v0.2 has been released? |
I'm not certain that the models are consistently emitting |
Hey @Rafaelblsilva sorry for missing this, for some reason I thought it overlapped with another format that was already supported. Thank you for the contribution! Note: I renamed the chat format to |
@abetlen Thanks for you work!
Here is my small contribution.