Skip to content

[model] kimi_k25 support mm#9497

Merged
Jintao-Huang merged 4 commits into
modelscope:mainfrom
Jintao-Huang:kimi_k25_support_mm
Jun 5, 2026
Merged

[model] kimi_k25 support mm#9497
Jintao-Huang merged 4 commits into
modelscope:mainfrom
Jintao-Huang:kimi_k25_support_mm

Conversation

@Jintao-Huang

Copy link
Copy Markdown
Collaborator

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds image support to the KimiK25Template class in swift/template/templates/moonshot.py by implementing custom replace_tag, _encode, _data_collator_mm_data, and _post_encode methods. The review feedback highlights three critical issues: first, replace_tag should fall back to super().replace_tag for non-image media types to prevent downstream TypeErrors; second, the list of tensors returned by _extract_image_features must be concatenated before being passed to mm_projector to avoid runtime errors; and third, the hardcoded media pad token ID should be dynamically retrieved from the tokenizer for better maintainability.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread swift/template/templates/moonshot.py
Comment thread swift/template/templates/moonshot.py
Comment thread swift/template/templates/moonshot.py
@Jintao-Huang Jintao-Huang merged commit 5bbdfc5 into modelscope:main Jun 5, 2026
2 of 3 checks passed
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