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 method to retrieve used chat template #32032

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

KonradSzafer
Copy link
Contributor

This PR introduces a new method that allows users to retrieve the chat template. It encapsulates the logic from the existing apply_chat_template method, enabling users to access the template without applying it.

Motivation:

  • Tracking of used chat templates in evaluation libraries for reproducibility
  • Allowing casual users to explicitly know which template is being used

I saw that you plan to introduce simplifications for managing chat templates in the next release (#31733). Please let us know if you think this will be relevant, thanks!

@Rocketknight1 @ArthurZucker @clefourrier

@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

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

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

LGTM, just want to make sur this is alright with you cc @Rocketknight1

Copy link
Member

@Rocketknight1 Rocketknight1 left a comment

Choose a reason for hiding this comment

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

This is a clean PR, and it makes sense to me. Thank you!

@Rocketknight1
Copy link
Member

@KonradSzafer if you pull the latest version of main and rebase your PR the failing test should pass and we can merge this!

@KonradSzafer KonradSzafer force-pushed the add-get-chat-template branch from d52c60b to 8470940 Compare July 22, 2024 17:34
@KonradSzafer
Copy link
Contributor Author

@ArthurZucker @Rocketknight1 thanks for the review! Done!

@ArthurZucker ArthurZucker merged commit 7405c1c into huggingface:main Jul 23, 2024
21 checks passed
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.

4 participants