Skip to content

docs: update function-calling.md w/ template override needed by functionary-small-v3.2 #12214

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

Merged
merged 1 commit into from
Mar 6, 2025

Conversation

ochafik
Copy link
Collaborator

@ochafik ochafik commented Mar 6, 2025

Fixes misleading command in doc revealed by #12213 (cc/ @edmcman): bartowski/functionary-small-v3.2-GGUF needs a template override.

Also, now using predownloaded templates under model/templates (used by test_tool_call.py) to simplify commands, and add extra blurb about the python script to get more templates.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Mar 6, 2025
@ochafik ochafik marked this pull request as ready for review March 6, 2025 01:06
@ochafik ochafik merged commit 4299404 into ggml-org:master Mar 6, 2025
2 checks passed
mglambda pushed a commit to mglambda/llama.cpp that referenced this pull request Mar 8, 2025
@pepijndevos
Copy link

Is there any plan to automatically provide the right templates if they are shipped with llama.cpp anyway? I might just apply them in my wrapper but just checking.

@ochafik
Copy link
Collaborator Author

ochafik commented Mar 16, 2025

Is there any plan to automatically provide the right templates if they are shipped with llama.cpp anyway? I might just apply them in my wrapper but just checking.

I think there are multiple options here:

  • (Ideally) Reach out to each maintainer of a GGUF with bad or out of date templates, and have them fix them.
  • Detect and explode on "bad" templates (maybe advising on using the GGUF editor to fix the template?)
  • Add a simple way to specify which HF repo to pull a template from (-hft / --hf-template flag? add the original HF repo as a key in the GGUF?)
  • Bundle a collection of "good" templates and use a mix of predicates on the model metadata to pick the right template (ignoring the template built into the GGUF)

I reckon we could add a flag that switches between the behaviours of the 3 last bullets

cc/ @ngxson @ggerganov WDYT?

@ngxson
Copy link
Collaborator

ngxson commented Mar 16, 2025

If the number of known broken templates are rare (i.e. the case of functionary, it is one of the first model to support function call so it was quite messy), then I don't want to spend too much effort fixing this.

The easiest solution is to simply bundle a collection of good templates as you said on your last point. I believe we will end up with a list of around 10 of them. Newer models should not need this, because they should already have a good built-in template.

arthw pushed a commit to arthw/llama.cpp that referenced this pull request Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants