Skip to content

No chat template in evaluation #2459

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

Open
xueyan-lii opened this issue Mar 5, 2025 · 5 comments
Open

No chat template in evaluation #2459

xueyan-lii opened this issue Mar 5, 2025 · 5 comments
Labels
community help wanted We would love the community's help completing this issue enhancement New feature or request

Comments

@xueyan-lii
Copy link

In LLAMA3 tokenizer, chat template is applied with the option to add system instruction. However, when using eleuther_eval.py, the tokenization process do not apply chat template. How can this be done?

@felipemello1
Copy link
Contributor

felipemello1 commented Mar 5, 2025

@joecummings , mind taking a look?

@felipemello1 felipemello1 added the bug Something isn't working label Mar 10, 2025
@krammnic
Copy link
Contributor

@felipemello1 It should be simple fix. We need to expose apply_chat_template argument in our wrapper (notice that it is not bool!). According to lm_eval: chat_template=getattr(lm, "apply_chat_template").

@pbontrager pbontrager linked a pull request Mar 11, 2025 that will close this issue
11 tasks
@pbontrager pbontrager removed a link to a pull request Mar 12, 2025
11 tasks
@pbontrager pbontrager added enhancement New feature or request and removed bug Something isn't working labels Mar 12, 2025
@pbontrager
Copy link
Contributor

I explored using torchtune's apply_chat_template here but since Eleuther does it's own formatting, they'd conflict with each other. To echo what @krammnic already said, we need to

  • override HFLM's "apply_chat_template" method in _LLMEvalWrapper shown here. This should stay mostly the same but grab the chat_template function that's inside the torchtune tokenizer here.
  • We also need to verify that the apply_chat_template from HF tokenizer is doing the same thing as torchtune's apply template.

@pbontrager pbontrager added the community help wanted We would love the community's help completing this issue label Mar 12, 2025
@krammnic
Copy link
Contributor

krammnic commented Apr 1, 2025

@pbontrager Can I take this now?

@joecummings
Copy link
Contributor

@pbontrager Can I take this now?

fire the lasers

@krammnic krammnic mentioned this issue Apr 9, 2025
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community help wanted We would love the community's help completing this issue enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants