Skip to content

fix: Add is_mtp parameter to _set_moe_state avoid type error#45

Merged
Jintao-Huang merged 2 commits intomodelscope:mainfrom
0hujun:fix-minimax-type-error
Apr 21, 2026
Merged

fix: Add is_mtp parameter to _set_moe_state avoid type error#45
Jintao-Huang merged 2 commits intomodelscope:mainfrom
0hujun:fix-minimax-type-error

Conversation

@0hujun
Copy link
Copy Markdown
Contributor

@0hujun 0hujun commented Apr 21, 2026

MinimaxM2Bridge类继承了GPTBridge类,但是其_set_moe_state的签名与GPTBridge类的不一致,缺少is_mtp变量。导致报错TypeError: MinimaxM2Bridge._set_moe_state() got an unexpected keyword argument 'is_mtp'。

这里由于MinimaxM2Bridge类的_set_moe_state方法体没有实际使用is_mtp变量,且在GPTBridge类中有mtp处理逻辑,所以直接在形参中添加is_mtp变量即可。

修改后,在NPU测试可正常训练Minimax M2.5。

Copy link
Copy Markdown

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

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 introduces an is_mtp parameter to the _set_moe_state method in minimax_m2.py. The review feedback suggests adding a default value of False to this parameter to maintain consistency with the base class and ensuring the parameter is correctly passed to the superclass method call to prevent logic errors.

Comment thread src/mcore_bridge/model/gpts/minimax_m2.py Outdated
@0hujun
Copy link
Copy Markdown
Contributor Author

0hujun commented Apr 21, 2026

关联isssue #44

@Jintao-Huang
Copy link
Copy Markdown
Collaborator

thanks!

@Jintao-Huang Jintao-Huang merged commit eaa991b into modelscope:main Apr 21, 2026
1 check 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