Add Llama 3 instruction template#5891
Conversation
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch (oobabooga#5257)
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
Merge dev branch
|
@Touch-Night sorry, it was my mistake :) Yeah it includes everything. Everything fine, sorry. P.S I deleted my message, but you still managed to reply :) |
Sorry I lost a |
your template is pretty solid, but it doesn't work for multi turn chats. This is the template we need to follow according to Meta. <|begin_of_text|><|start_header_id|>system<|end_header_id|> {{ system_prompt }}<|eot_id|><|start_header_id|>user<|end_header_id|> {{ user_message_1 }}<|eot_id|><|start_header_id|>assistant<|end_header_id|> {{ model_answer_1 }}<|eot_id|><|start_header_id|>user<|end_header_id|> {{ user_message_2 }}<|eot_id|><|start_header_id|>assistant<|end_header_id|> which sadly I'm not too sure how to implement into ooba |
I don't see how. It works great for me. I don't think it's because this template doesn't work for multi turn chats. Is your context window too small? |
I load models at 4k context but usually around the 2k mark (depending on base prompt) outputs become identical (this is with varied settings). currently it outputs like this: <|begin_of_text|><|start_header_id|>system<|end_header_id|> Persona of your AI assistant who does stuff and speaks in a certain way.<|eot_id|><|start_header_id|>user<|end_header_id|> User: Hello! instead it should be: <|begin_of_text|><|start_header_id|>system<|end_header_id|> Persona of your AI assistant who does stuff and speaks in a certain way.<|eot_id|><|start_header_id|>user<|end_header_id|> User: Hello!<|eot_id|><|start_header_id|>assistant<|end_header_id|> Bot: Hi!<|eot_id|><|start_header_id|>user<|end_header_id|> User: How are you?<|eot_id|><|start_header_id|>assistant<|end_header_id|> |
|
This is an intended prompt design by @oobabooga . It's not a thing that can be done with an instruction template. Try editing chat template instead. You can try this Chat template (redundant, not tested, may be wrong): |
You're right. I'll do it ASAP with chat template. Will edit this comment with results. |
This one is the template I use to achieve the meta recommendation, ooba complained a lot about yours and was a bit too long for me to look how to fix. It works like a charm in chat mode. I still need to figure out which generation settings to use since I still encounter repetition errors but I hope this helps anyone looking for what I was looking for. |
Merge dev branch
Won't it end up like this? This chat template will cause:
|
Like I said, it's already working as intended for me. This isn't that clean of a solution anyway, since it should be achievable through instruct mode, how I assume most people use models these days. |
|
Sorry, you said
So I thought you are using chat-instruct mode. Anyway, one chat template cannot achieve the meta recommendation on chat and chat-instruct mode at the same time. Mine for chat-instruct mode and yours for chat mode. I'm aware that users should not mess with the turn order, but since it's possible, there will be such user doing that. I want to make sure Llama 3 doesn't wrongly regard a user message as from assistant. |
|
anny progress ? if i use llama3 without any Modifications in notpad as (alpaca) the tts based on Coqui_tts talks in the chat with his sself untill ... ^^ |
|
I think this template needs no more changes, it's done. So no progress unless @oobabooga gives his advice on something like should the <|begin_of_text|> be added to the template. |
|
i dont know where i should copy that in oobadoga i can only use the llama3 template from gpt4all and there i know where i can copy/paste ^^ |
|
What about <|begin_of_text|>? There is an another template https://github.com/mamei16/LLM_Web_search/blob/main/instruction_templates/Llama-3.yaml |
I'm not so sure that |
|
I don't like adding the BOS token to instruct templates, as every tokenizer already adds it automatically by default. In fact, I go out of my way to remove the BOS token from instruction templates somewhere in this repository to prevent a double BOS from happening. Note that Llama-3 chat models already come with a template in the metadata, which gets detected and applied automatically, so it's not necessary to have a dedicated yaml. |
A simple template
Checklist: