Skip to content

Fix revision arg for vLLM tokenizer #721

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 4 commits into from
May 15, 2025
Merged

Conversation

lewtun
Copy link
Member

@lewtun lewtun commented May 15, 2025

This PR fixes a nasty bug where the tokenizer revision is set to the default value of main, irrespective of the revision provided in the model config. The reason is because tokenizer_revision is not a proper kwarg for get_tokenizer(), so we always default to main when loading the tokenizer in vllm.

Tested on this dummy model which has different chat templates on the main and new_chat_template branches: https://huggingface.co/lighteval/different-chat-templates-per-revision

The unit test fails on main with (as expected):

E       AssertionError: 'chat-template-on-main' != 'chat-template-on-revision'
E       - chat-template-on-main
E       ?                  ^^
E       + chat-template-on-revision
E       ?                  ^^^ +++

tests/models/vllm/test_vllm_model.py:17: AssertionError

It passes on this branch :)

@lewtun lewtun requested review from NathanHB and clefourrier May 15, 2025 10:05
@HuggingFaceDocBuilderDev
Copy link
Collaborator

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

@clefourrier clefourrier left a comment

Choose a reason for hiding this comment

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

Haa good catch thanks!
Could it be an arg which changed name in vllm history?

@lewtun
Copy link
Member Author

lewtun commented May 15, 2025

Could it be an arg which changed name in vllm history?

No idea, but could well be...

@clefourrier
Copy link
Member

Hm, I guess since we pin vllm's lower bound we don't need to care ^^

@lewtun lewtun merged commit d3da6b9 into main May 15, 2025
5 checks passed
Copy link
Contributor

@edbeeching edbeeching left a comment

Choose a reason for hiding this comment

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

Thanks

hynky1999 pushed a commit that referenced this pull request May 22, 2025
* Fix revision arg for vLLM tokenizer

* Add unit test

* Update test

* Move test repo
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