-
Notifications
You must be signed in to change notification settings - Fork 562
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
Clarification on the system prompt for custom tool use #36
Comments
cc: @ashwinb |
@ricklamers thanks for pointing out the discrepancy. Please use the version as specified in the code / this repo. We will update our documentation to match the version from the code. Re: parallel tool calling, we are doing a couple quick experiments and will get back to you on that ASAP. |
Awesome, thanks! |
@ashwinb FYI in HF's chat template yet another prompt is used: Is that wrong? Should it follow the one in this repo? |
@ricklamers :( not happy with these inconsistencies. it is hard to say something is wrong given the general stochasticity with tool calling unfortunately. all I will say is that this is the reason we put |
No worries, as long as we know the correct system prompt (this repo) we can all adjust to converge to the same correct version. Any updates on parallel calls? |
I've put out a note for them https://huggingface.co/meta-llama/Meta-Llama-3.1-8B-Instruct/discussions/90 |
Hey, Matt from Hugging Face here. Just to clarify, the HF template was written following the "JSON based tool calling" template in this doc, and the prompt we used was also copied from the example prompt there. Based on this discussion, am I correct that the |
So which template is preferred? The function one or the json one? They are both at https://llama.meta.com/docs/model-cards-and-prompt-formats/llama3_1/ |
Both the json version and function version work reasonably well. We observed that the json one tends to over steer to using tools even when one is not asked for while with |
Unfortunately, we kind of have to pick one for the template! One thing we noticed is that with the current JSON template, 8B makes tool calls correctly, but sometimes fails to use the results correctly in chat - not sure if this is an issue with the system message we used, since it was all copied from the doc. My suspicion is that an alternate prompt would fix a lot of this, and we'd prefer to have a clear answer on the best way to do things rather than several options! |
We updated the default tool format to be #45 The code also supports the Use this command to get the latest recommended format,
Some caveats,
Hope this helps resolve the confusion. Again, thanks for raising these issues, it helps us get better and improve with each version. |
@hardikjshah I think the |
Hello, this is Pedro from Hugging Face. I've been trying today to verify the tool calling template that is in use for the Llama 3.2 models. My approach was to start with the documentation provided by
or the following, when the additional instructions are honored:
Should a newline separator be used after the tool definitions?
The reason I'm asking these questions is I've found the use of tools fragile in the small 3.2 text models. We'd like to reduce the ambiguity as much as possible, and provide a validated chat template to the community so developers can experiment with confidence. |
@hardikjshah It doesn't seem like this command is valid anymore: See https://colab.research.google.com/drive/1JCPiY8pvP6ZGG2xGvJzrnx7ntfrPeCHX?usp=sharing |
Awesome work! Just a quick question about the correct system prompt:
in the docs https://llama.meta.com/docs/model-cards-and-prompt-formats/llama3_1#user-defined-custom-tool-calling this is used:
While in the repo this is used:
Furthermore, could you clarify if the "Only call one function at a time" implies parallel tool use is not intended to be used for these instruction tuned models (Llama 3.1 family)?
e.g. "Please get the weather for San Francisco and Tokyo" can't generate:
Thanks for clarifying!
Rick Lamers
AI Researcher at Groq
The text was updated successfully, but these errors were encountered: