KEMBAR78
Fix config dtype parsing for Emu3 edge case by Isotr0py · Pull Request #40766 · huggingface/transformers · GitHub
Skip to content

Conversation

@Isotr0py
Copy link
Collaborator

@Isotr0py Isotr0py commented Sep 9, 2025

What does this PR do?

Fixes vllm-project/vllm#24447 (comment)

  • "dtype" is one of token in Emu3Config's vocabulary_map, so current config dtype parsing logic can run into issue for vocab_map {'dtype': 47727}.
  • This PR makes the dtype parsing logic more robust.

Reproduction code

from transformers import AutoConfig

config = AutoConfig.from_pretrained("BAAI/Emu3-Chat-hf")
print(config)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
@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.

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
Copy link
Member

@zucchini-nlp zucchini-nlp left a comment

Choose a reason for hiding this comment

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

Thanks, lgtm. Maybe add a comment explaining why it is needed so we don't accidentally remove it in the future and we can merge

Approving in advance

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
@zucchini-nlp zucchini-nlp enabled auto-merge (squash) September 11, 2025 08:19
@zucchini-nlp zucchini-nlp merged commit 02f1d7c into huggingface:main Sep 11, 2025
23 checks passed
@Isotr0py Isotr0py deleted the fix-emu3-config branch September 11, 2025 08:34
@ArthurZucker ArthurZucker added the for patch Tag issues / labels that should be included in the next patch label Sep 12, 2025
LysandreJik pushed a commit that referenced this pull request Sep 17, 2025
* fix emu3 config

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>

* address comment

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>

* add comments

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>

---------

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
vijayabhaskar-ev pushed a commit to vijayabhaskar-ev/transformers that referenced this pull request Oct 2, 2025
* fix emu3 config

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>

* address comment

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>

* add comments

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>

---------

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
yuchenxie4645 pushed a commit to yuchenxie4645/transformers that referenced this pull request Oct 4, 2025
* fix emu3 config

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>

* address comment

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>

* add comments

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>

---------

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

for patch Tag issues / labels that should be included in the next patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants