Skip to content

Configuration insoncistencies#45194

Closed
zucchini-nlp wants to merge 6 commits intohuggingface:mainfrom
zucchini-nlp:configs-fix-inconstency
Closed

Configuration insoncistencies#45194
zucchini-nlp wants to merge 6 commits intohuggingface:mainfrom
zucchini-nlp:configs-fix-inconstency

Conversation

@zucchini-nlp
Copy link
Copy Markdown
Member

@zucchini-nlp zucchini-nlp commented Apr 2, 2026

What does this PR do?

Fixes:

  • Replace PretrainedConfig with PreTrainedConfig
  • Don't import from other models inside configuration_model.py, instead resolve via modular
  • Text/vision sub-configs are documented (only kosmos was missing)
  • Qwen-vision model type is changed, otherwise we have the same model type for Qwen2VLConfig and Qwen2VLVisionConfig. Vision backbones are not auto-mapped yet and were not even a PreTrainedModel in the past. So it won't break anything, and official checkpoint don't have model_type saved anyway
  • Nougat has its own config class, instead of mapping to VisionEncoderDecoderConfig with a different model type. Rn in config's auto mapping, the VisionEncoderDecoderConfig resolves to vision-encoder-decoder by accident, we are just lucky it comes last and overwrites nougat. IMO no config class should map to two model types, since model type is a ClassVar

I wonder if we should be adding linter checks on a few of these, specifically no importing from other models and each config class maps to single model_type?

P.S. Uncovered everything when trying to dynamically build the MAPPING in #45018


self.audio_config = CONFIG_MAPPING[self.audio_config["model_type"]](**self.audio_config)
elif self.audio_config is None:
self.audio_config = CONFIG_MAPPING["musicflamingo_encoder"]()
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.

model_type = musicflamingo_encoder doesn't exist

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

@zucchini-nlp
Copy link
Copy Markdown
Member Author

I think we can keep it as part of the bigger PR, closing

@github-actions
Copy link
Copy Markdown
Contributor

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

run-slow: eurobert, fastspeech2_conformer, kosmos2, musicflamingo, nanochat, nougat, qwen2_5_vl, qwen2_vl, qwen3_5, qwen3_5_moe, qwen3_vl, qwen3_vl_moe, speecht5, vibevoice_asr, voxtral_realtime

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.

2 participants