Skip to content

[bugfix] fix create_optimizer#9282

Merged
Jintao-Huang merged 2 commits into
modelscope:mainfrom
Jintao-Huang:fix_create_optimizer
May 7, 2026
Merged

[bugfix] fix create_optimizer#9282
Jintao-Huang merged 2 commits into
modelscope:mainfrom
Jintao-Huang:fix_create_optimizer

Conversation

@Jintao-Huang
Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Contributor

@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 modifies the create_optimizer signature across several optimizer callback classes to support an optional model parameter, allowing for more flexible optimizer initialization. While most implementations correctly handle the new parameter, the change in swift/optimizers/base.py incorrectly attempts to pass the model argument to the base Hugging Face trainer's create_optimizer method, which will result in a TypeError as that method does not accept such an argument.

Comment thread swift/optimizers/base.py
@Jintao-Huang Jintao-Huang merged commit 19b5371 into modelscope:main May 7, 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