-
Notifications
You must be signed in to change notification settings - Fork 520
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
chore: support preset bias of atomic model output #4116
chore: support preset bias of atomic model output #4116
Conversation
WalkthroughWalkthroughThe pull request introduces modifications to the Changes
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (2)
Files skipped from review as they are similar to previous changes (1)
Additional comments not posted (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## devel #4116 +/- ##
==========================================
- Coverage 83.02% 83.02% -0.01%
==========================================
Files 532 532
Lines 52174 52187 +13
Branches 3030 3031 +1
==========================================
+ Hits 43319 43328 +9
- Misses 7911 7913 +2
- Partials 944 946 +2 ☔ View full report in Codecov by Sentry. |
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.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
deepmd/pt/model/model/__init__.py (1)
Line range hint
171-224
: LGTM, but remove the unused variable.The changes to
get_standard_model
look good. The newpreset_out_bias
parameter is correctly processed through the new helper function_convert_preset_out_bias_to_torch_tensor
, allowing for user-defined biases in model configurations.However, the static analysis tools have correctly identified that the variable
default_preset_out_bias
at line 197 is unused.Please remove the unused variable:
-default_preset_out_bias = [None] * len(model_params["type_map"]) preset_out_bias = model_params.get("preset_out_bias")
Tools
Ruff
197-197: Local variable
default_preset_out_bias
is assigned to but never usedRemove assignment to unused variable
default_preset_out_bias
(F841)
GitHub Check: CodeQL
[notice] 197-197: Unused local variable
Variable default_preset_out_bias is not used.
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.
Actionable comments posted: 1
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Han Wang <92130845+wanghan-iapcm@users.noreply.github.com>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
|
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new `preset_out_bias` parameter for enhanced model configuration, allowing users to define biases. - Added documentation for the `preset_out_bias` parameter in the model arguments for improved clarity. - **Bug Fixes** - Implemented validation to ensure the `preset_out_bias` length matches the model's type map, preventing runtime errors. - **Tests** - Added unit tests for the `get_model` function to validate model attributes and ensure proper error handling for the new bias parameter. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Han Wang <92130845+wanghan-iapcm@users.noreply.github.com> Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu> Co-authored-by: Han Wang <wang_han@iapcm.ac.cn> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Summary by CodeRabbit
New Features
preset_out_bias
parameter for enhanced model configuration, allowing users to define biases.preset_out_bias
parameter in the model arguments for improved clarity.Bug Fixes
preset_out_bias
length matches the model's type map, preventing runtime errors.Tests
get_model
function to validate model attributes and ensure proper error handling for the new bias parameter.