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

Make "tool_use" the default chat template key when tools are passed #31429

Merged
merged 3 commits into from
Jun 18, 2024

Conversation

Rocketknight1
Copy link
Member

We've started to see models with multiple templates, keyed by name. The standard name (or at least the standard I'm trying to enforce) is that the template for tool use is called tool_use.

This PR updates the chat template logic so that if there's a template named "tool_use" and the user has passed tools, then that template will be used as the default.

@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
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

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

LGTM - thanks!

Could you add some information in the documentation about this, so that people don't need to dig into the code to know this

@Rocketknight1
Copy link
Member Author

Will do!

@Rocketknight1 Rocketknight1 force-pushed the update_chat_template_default branch from 5c43cd7 to 415a08e Compare June 17, 2024 19:06
@Rocketknight1
Copy link
Member Author

@amyeroberts I added some opinionated text where I explain this and try to dissuade people from writing templates this way (I might eventually chase down the cases where people are doing it and ban it as a feature, we'll see!)

@Rocketknight1 Rocketknight1 merged commit dabf019 into main Jun 18, 2024
22 checks passed
@Rocketknight1 Rocketknight1 deleted the update_chat_template_default branch June 18, 2024 12:54
itazap pushed a commit that referenced this pull request Jun 18, 2024
…31429)

* Make "tool_use" the default when tools are passed

* Add some opinionated text to the docs

* Add some opinionated text to the docs
itazap pushed a commit that referenced this pull request Jun 20, 2024
…31429)

* Make "tool_use" the default when tools are passed

* Add some opinionated text to the docs

* Add some opinionated text to the docs
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