-
Couldn't load subscription status.
- Fork 5
Refine merge script #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds configurable aggregation options to a model merging script, allowing users to specify custom weights for each model and choose between averaging or summing parameters.
- Added
--source-weightsparameter to specify individual model weights - Added
--aggregation-methodparameter to choose between "average" and "sum" operations - Modified parameter accumulation logic to use weighted calculations instead of simple averaging
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| if param_sums[key].shape != tensor.shape: | ||
| raise ValueError(f"Shape mismatch for key '{key}': " | ||
| f"{param_sums[key].shape} vs {tensor.shape}") | ||
| param_sums[key] += tensor |
Copilot
AI
Aug 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter accumulation is not applying the weights. It should be param_sums[key] += tensor * weight to properly implement weighted merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
|
@reiyw ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
モデルマージ用スクリプトに計算式を変更するオプションを追加:
何も指定しなければ単純な相加平均になります。