Skip to content

[ vllm x v5] nit#44971

Merged
ArthurZucker merged 6 commits intomainfrom
small-nit
Mar 24, 2026
Merged

[ vllm x v5] nit#44971
ArthurZucker merged 6 commits intomainfrom
small-nit

Conversation

@ArthurZucker
Copy link
Collaborator

@ArthurZucker ArthurZucker commented Mar 24, 2026

What does this PR do?

Removed the tokenizer_class attr was never there to begin with, and kwargs are now supported.
This was failing some test on vllm ci. Fixes https://buildkite.com/vllm/ci/builds/57601/steps/canvas?sid=019d1aec-aa5a-41db-bac6-4f42397279d5

In [6]: pip = pipeline("text-generation", "XiaomiMiMo/MiMo-7B-Base")
The repository XiaomiMiMo/MiMo-7B-Base contains custom code which must be executed to correctly load the model. You can inspect the repository content at https://hf.co/XiaomiMiMo/MiMo-7B-Base .
 You can inspect the repository content at https://hf.co/XiaomiMiMo/MiMo-7B-Base.
rue`.an avoid this prompt in future by passing the argument `trust_remote_code=T 

Do you wish to run the custom code? [y/N] y
The repository XiaomiMiMo/MiMo-7B-Base contains custom code which must be executed to correctly load the model. You can inspect the repository content at https://hf.co/XiaomiMiMo/MiMo-7B-Base .
 You can inspect the repository content at https://hf.co/XiaomiMiMo/MiMo-7B-Base.
rue`.an avoid this prompt in future by passing the argument `trust_remote_code=T 

Do you wish to run the custom code? [y/N] y
The repository XiaomiMiMo/MiMo-7B-Base contains custom code which must be executed to correctly load the model. You can inspect the repository content at https://hf.co/XiaomiMiMo/MiMo-7B-Base .
 You can inspect the repository content at https://hf.co/XiaomiMiMo/MiMo-7B-Base.
rue`.an avoid this prompt in future by passing the argument `trust_remote_code=T 

Do you wish to run the custom code? [y/N] y
modeling_mimo.py: 3.53kB [00:00, 2.34MB/s]
A new version of the following files was downloaded from https://huggingface.co/XiaomiMiMo/MiMo-7B-Base:
- modeling_mimo.py
. Make sure to double-check they do not contain any added malicious code. To avoid downloading new versions of the code file, you can pin a revision.
model.safetensors.index.json: 37.0kB [00:00, 16.4MB/s]
Fetching 4 files: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [01:58<00:00, 29.64s/it]
Download complete: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 15.7G/15.7G [01:58<00:00, 132MB/s]
Loading weights: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 451/451 [00:00<00:00, 6320.50it/s]
generation_config.json: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 138/138 [00:00<00:00, 582kB/s]
The repository XiaomiMiMo/MiMo-7B-Base contains custom code which must be executed to correctly load the model. You can inspect the repository content at https://hf.co/XiaomiMiMo/MiMo-7B-Base .
 You can inspect the repository content at https://hf.co/XiaomiMiMo/MiMo-7B-Base.
rue`.an avoid this prompt in future by passing the argument `trust_remote_code=T 

Do you wish to run the custom code? [y/N] y
tokenizer_config.json: 7.23kB [00:00, 6.69MB/s]
vocab.json: 2.78MB [00:00, 11.2MB/s]
merges.txt: 1.67MB [00:00, 12.6MB/s]
tokenizer.json: 7.03MB [00:00, 21.2MB/s]

In [7]: pip("Hey how are you?")
Both `max_new_tokens` (=256) and `max_length`(=20) seem to have been set. `max_new_tokens` will take precedence. Please refer to the documentation for more information. (https://huggingface.co/docs/transformers/main/en/main_classes/text_generation)
Out[7]: [{'generated_text': "Hey how are you? I'm in the same boat as you. I'm 18 years old and I'm currently a sophomore in college. I've been struggling with depression for about 5 years now and it's getting worse. I've been on medication for a long time to help me cope, but I still struggle. I'm not sure if I'm going to make it through college. I've been thinking about suicide a lot lately. I don't know if I can do it. I don't know if I'm strong enough. I'm just lost. I don't know what to do. I'm sorry for being a burden to you. I hope you can find some relief."}]

checked and this works expectedly.

config = AutoConfig.from_pretrained("XiaomiMiMo/MiMo-7B-Base", trust_remote_code=True)

@ArthurZucker ArthurZucker marked this pull request as ready for review March 24, 2026 15:00
Copy link
Member

@hmellor hmellor left a comment

Choose a reason for hiding this comment

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

Should we also remove this from MT5 and UMT5 then?

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.

Nice, iirc we don't assume it exists in codebase so lgtm

@github-actions
Copy link
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: mt5, umt5

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes the tokenizer_class attribute from the base PreTrainedConfig and from the MT5/UMT5 config classes, aligning tokenizer selection away from config-level defaults and toward tokenizer config/mappings (as referenced by the vLLM CI failure in the PR description).

Changes:

  • Remove tokenizer_class from MT5Config and UMT5Config (docstring + class attribute).
  • Remove the tokenizer_class field (and its import dependency) from PreTrainedConfig.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/transformers/models/umt5/configuration_umt5.py Drops tokenizer_class from UMT5 config surface and docs.
src/transformers/models/mt5/configuration_mt5.py Drops tokenizer_class from MT5 config surface and docs.
src/transformers/configuration_utils.py Removes the base PreTrainedConfig.tokenizer_class field and the now-unused tokenizer import.

Comment on lines 231 to 235
# Fine-tuning task arguments
id2label: dict[int, str] | dict[str, str] | None = None
label2id: dict[str, int] | dict[str, str] | None = None
problem_type: Literal["regression", "single_label_classification", "multi_label_classification"] | None = None

Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

Removing tokenizer_class from PreTrainedConfig will break existing tests/utilities that treat it as a common config kwarg/field (e.g. tests/utils/test_configuration_utils.py::test_config_common_kwargs_is_complete expects tokenizer_class to be present in PreTrainedConfig().__dict__). Please update the corresponding test expectations (and any shared config_common_kwargs/common-config logic) to reflect the new base config surface, or keep a backward-compatible tokenizer_class field if it’s still considered part of the common config contract.

Copilot uses AI. Check for mistakes.
@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.

@github-actions
Copy link
Contributor

View the CircleCI Test Summary for this PR:

https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=44971&sha=ece5f2

@ArthurZucker ArthurZucker merged commit 692d187 into main Mar 24, 2026
28 of 30 checks passed
@ArthurZucker ArthurZucker deleted the small-nit branch March 24, 2026 17:40
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.

5 participants