Skip to content

Clearer type hints and fix rope validation in configs#44943

Merged
zucchini-nlp merged 3 commits intohuggingface:mainfrom
zucchini-nlp:configs-and-more-configs
Mar 23, 2026
Merged

Clearer type hints and fix rope validation in configs#44943
zucchini-nlp merged 3 commits intohuggingface:mainfrom
zucchini-nlp:configs-and-more-configs

Conversation

@zucchini-nlp
Copy link
Copy Markdown
Member

What does this PR do?

@hmellor

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

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.

Comment on lines +4218 to +4225
# `fields(cls)` returns only the annotations defined on cls exclduing `ClassVar`
# (e.g. model_type). Also exclude two quasi-ClassVar fields which can `setattr` and
# saved in config. These do not act as class attributes and thus cannot be `ClassVar`
# in its general sense.
own_config_params = {
field.name for field in fields(cls) if field.name not in ["transformers_version", "architectures"]
}
allowed_params = own_config_params if own_config_params else None
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Almost same as in Yoni's upcoming PR, and I needed it to skip transformers_version/architectures from raising warnings
These two fields are not 100% class attributes in general sense

@zucchini-nlp zucchini-nlp added this pull request to the merge queue Mar 23, 2026
Merged via the queue into huggingface:main with commit ed003b4 Mar 23, 2026
28 checks passed
@zucchini-nlp zucchini-nlp deleted the configs-and-more-configs branch March 23, 2026 13:32
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.

3 participants