You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
get_chat_template using <|eot_id|> for tool use when <|eom_id|> should be used. #845
With llama 3.1 <|eom_id|> has been introduced to help support multi-turn reasoning.
End of message. A message represents a possible stopping point for execution where the model can inform the executor that a tool call needs to be made. This is used for multi-step interactions between the model and any available tools. This token is emitted by the model when the Environment: ipython instruction is used in the system prompt, or if the model calls for a built-in tool.
Currently get_chat_template is returning function calls with <|eot_id|> at the end of each request.
I am planning to train Corpus with Llama 3.1 8b instruct and I noticed instruct model requires specific prompt. so I customized the function like this for Corpus training(SFTtraining)
I think this approach goes some way, and I'm curious if it's enough, but <|eot_id|> is not used in this example at all and I think omitting this could have a similar affect on model performance. I don't know if omitting one versus the other is preferrable, but it would be great to have a solution where only responses had eom and eot otherwise.
Activity
skmanzg commentedon Aug 1, 2024
I am planning to train Corpus with Llama 3.1 8b instruct and I noticed instruct model requires specific prompt. so I customized the function like this for Corpus training(SFTtraining)
I haven't tried it yet with it but will it work? or will it be problematic?
William-Wildridge commentedon Aug 1, 2024
I think this approach goes some way, and I'm curious if it's enough, but <|eot_id|> is not used in this example at all and I think omitting this could have a similar affect on model performance. I don't know if omitting one versus the other is preferrable, but it would be great to have a solution where only responses had eom and eot otherwise.
danielhanchen commentedon Aug 2, 2024
Oh for tool use - yes <|eom_id|> should be used - I'll need to create a new chat template specifically it seems for tool usage
asmith26 commentedon Aug 22, 2024
Just wondering if anyone has successfully created a Google Colab notebook regarding finetuning tools for Llama 3.1? Thanks!
danielhanchen commentedon Aug 24, 2024
Interesting idea - I might make a notebook for tool calling!
kldzj commentedon Oct 20, 2024
@danielhanchen are there any news regarding a tool calling notebook? :)
rolandtannous commentedon Jun 6, 2025
@kldzj @asmith26 @William-Wildridge @skmanzg tool calling notebook https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen2.5_Coder_(1.5B)-Tool_Calling.ipynb
Revert "Studio: exclude mlx-lm 0.31.3 (broke gemma4/qwen3_5 QK-norm l…
Revert "Studio: exclude mlx-lm 0.31.3 (broke gemma4/qwen3_5 QK-norm l…