Skip to content

Conversation

odashi
Copy link
Member

@odashi odashi commented Aug 19, 2025

モデルマージ用スクリプトに計算式を変更するオプションを追加:

  • 平均か総和か
  • 各モデルの重み
    何も指定しなければ単純な相加平均になります。

@odashi odashi requested review from hkiyomaru and Copilot August 19, 2025 04:46
Copy link

@Copilot Copilot AI left a 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-weights parameter to specify individual model weights
  • Added --aggregation-method parameter 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.

@@ -87,36 +125,36 @@ def main():
raise ValueError(f"Shape mismatch for key '{key}': "
f"{param_sums[key].shape} vs {tensor.shape}")
param_sums[key] += tensor
Copy link
Preview

Copilot AI Aug 19, 2025

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.

Copilot uses AI. Check for mistakes.

@odashi odashi changed the title V4 diff モデルマージスクリプトの改良 Aug 19, 2025
@odashi odashi changed the title モデルマージスクリプトの改良 Refine merge script Aug 19, 2025
@odashi odashi requested a review from reiyw August 19, 2025 05:05
@odashi odashi requested a review from Copilot August 19, 2025 05:28
Copy link

@Copilot Copilot AI left a 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.

@odashi
Copy link
Member Author

odashi commented Aug 29, 2025

@reiyw ping

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