fix(Phi4Multimodal): Fix incorrect default vision/audio config initialization in Phi4MultimodalConfig#43480
Merged
Rocketknight1 merged 2 commits intohuggingface:mainfrom Jan 26, 2026
Conversation
3b311a3 to
1bb4347
Compare
Rocketknight1
approved these changes
Jan 26, 2026
Member
Rocketknight1
left a comment
There was a problem hiding this comment.
Wow, yes, this is clearly incorrect. I guess it wasn't spotted because vision/audio configs are explicitly passed in from_pretrained() most of the time. Thank you for the fix!
…rations in Phi4MultimodalConfig
…hi4MultimodalConfig
1bb4347 to
0015de9
Compare
Contributor
|
[For maintainers] Suggested jobs to run (before merge) run-slow: phi4_multimodal |
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🐛 Bug Fix: Phi4MultimodalConfig default sub-config initialization
This PR fixes two issues in
Phi4MultimodalConfig.__init__related to default initialization of multimodal sub-configs.Rations in Phi4MultimodalConfig
What does this PR do?
❌ Problems fixed
vision_configisNone, a defaultPhi4MultimodalVisionConfig()was instantiated but not assigned, leavingself.vision_configasNone.audio_configdefault initialization incorrectly checkedvision_config is Noneinstead ofaudio_config is None.✅ Changes
🎯 Impact
Ensures
vision_configandaudio_configare always valid config objects when omittedPrevents downstream errors caused by unexpected
NonevaluesImproves consistency with other multimodal config implementations
No behavior change for users explicitly passing configs.
Let me know if you'd like tests added or additional adjustments.
This pull request fixes initialization logic for the vision and audio configuration objects in the
Phi4MultimodalModelconstructor. The changes ensure that default configuration objects are correctly assigned when none are provided.Configuration initialization fixes:
vision_configandaudio_configobjects in the__init__method ofmodular_phi4_multimodal.py, ensuring that they are properly instantiated when not provided.Fixes #43479
Before submitting
Pull Request section?
to it if that's the case.
Fixing the issue: Phi4MultimodalConfig incorrectly initializes default vision/audio configs when passed as None #43479
documentation guidelines, and
here are tips on formatting docstrings.
I don't think this PR need to update the documentation. Please correct me and I'll add additional submits to this PR.
I don't think any additional test is needed. Please let me know if it's reuqired and I'll add additional submits to this PR.
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.
@Cyrilvallez