Skip to content
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

Add a section on writing tool templates to the chat template docs #33924

Merged
merged 2 commits into from
Oct 4, 2024

Conversation

Rocketknight1
Copy link
Member

The chat template docs have an extensive section on using tool templates, but they're missing good guidance to template authors. I added a section to help them, and also so there's a point of reference for the API we expect tool templates to follow.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Member

@pcuenca pcuenca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super clear, I really like it! I hope model authors read it 😅

```

A common pattern for handling tools in chat templates would be something like this:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is clear that these are examples and there's also a mention at the end, but maybe we can reinforce even more and explicitly state it here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@Rocketknight1
Copy link
Member Author

I'm happy with this now - merging without core maintainer review since it's a pure documentation change

@Rocketknight1 Rocketknight1 merged commit de4112e into main Oct 4, 2024
9 checks passed
@Rocketknight1 Rocketknight1 deleted the tool_template_writing_docs branch October 4, 2024 13:40
NielsRogge pushed a commit to NielsRogge/transformers that referenced this pull request Oct 21, 2024
…ggingface#33924)

* Add a section on writing tool templates to the chat template docs

* Small cleanups
BernardZach pushed a commit to BernardZach/transformers that referenced this pull request Dec 5, 2024
…ggingface#33924)

* Add a section on writing tool templates to the chat template docs

* Small cleanups
BernardZach pushed a commit to innovationcore/transformers that referenced this pull request Dec 6, 2024
…ggingface#33924)

* Add a section on writing tool templates to the chat template docs

* Small cleanups
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants