[model] support kimi_k25#52
Merged
Jintao-Huang merged 3 commits intomodelscope:mainfrom Apr 27, 2026
Merged
Conversation
hjh0119
approved these changes
Apr 27, 2026
There was a problem hiding this comment.
Code Review
This pull request introduces support for the Kimi-K25 model by adding the kimi_k25 model type and implementing the KimiK25Vit class. It also updates the model configuration to include a support_multimodal flag. Review feedback suggests using getattr when accessing this flag to avoid potential AttributeError and replacing an assert statement with a ValueError to ensure configuration validation is not disabled in production.
| self.mcore_model_type = get_mcore_model_type(self.hf_model_type) | ||
| self.model_meta = get_model_meta(self.mcore_model_type) | ||
| self.is_multimodal = self.model_meta.visual_cls is not None | ||
| self.support_multimodal = self.is_multimodal and self.model_meta.visual_cls.support_multimodal |
There was a problem hiding this comment.
Accessing support_multimodal directly on visual_cls might raise an AttributeError if the visual class does not define this attribute (e.g., if it doesn't inherit from HuggingFaceVit). Using getattr with a default value is safer.
Suggested change
| self.support_multimodal = self.is_multimodal and self.model_meta.visual_cls.support_multimodal | |
| self.support_multimodal = self.is_multimodal and getattr(self.model_meta.visual_cls, 'support_multimodal', True) |
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.
No description provided.