Skip to content

🚨 [v5] Rendundant code in nested configs#41314

Merged
zucchini-nlp merged 10 commits into
huggingface:mainfrom
zucchini-nlp:neste-config-redundant-code
Oct 9, 2025
Merged

🚨 [v5] Rendundant code in nested configs#41314
zucchini-nlp merged 10 commits into
huggingface:mainfrom
zucchini-nlp:neste-config-redundant-code

Conversation

@zucchini-nlp
Copy link
Copy Markdown
Member

What does this PR do?

This PR deletes from_xxx_config and similar methods from everywhere and instead ensures that the config init can accept subconfigs of all formats (dict or object)

Along the way, I found that not all configs call super init in the end and thus they can't set recursively attn implementation on subconfigs. I added a test for it and fixed all cases

@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.

Copy link
Copy Markdown
Member

@Cyrilvallez Cyrilvallez left a comment

Choose a reason for hiding this comment

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

Nice, happy to clean them up, they are not really useful indeed!
Let's just remove the logger.info entries everywhere (I only flagged it once in the comments) at the same time!

semantic_config = {}
logger.info("semantic_config is None. initializing the semantic model with default values.")
semantic_config = BarkSemanticConfig()
logger.info("`semantic_config` is `None`. Initializing the `BarkSemanticConfig` with default values.")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's remove those logs instead wdyt? One of the v5 goals is to have fewer and more informatives warnings and logs!

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.

oke, they are not super informative anyway

Comment thread src/transformers/models/mm_grounding_dino/modular_mm_grounding_dino.py Outdated
@zucchini-nlp zucchini-nlp enabled auto-merge (squash) October 9, 2025 09:38
@zucchini-nlp zucchini-nlp merged commit d1c6310 into huggingface:main Oct 9, 2025
25 checks passed
@zucchini-nlp zucchini-nlp mentioned this pull request Oct 9, 2025
AhnJoonSung pushed a commit to AhnJoonSung/transformers that referenced this pull request Oct 12, 2025
* batch update models

* delete even more

* fix modular super init location

* fix

* fix copies

* fix again, these have force-set values in configs

* fix copies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants