-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Unified Checkpoint] Fix tie_weights save and load #8137
Conversation
Thanks for your contribution! |
1e60c8f
to
2136923
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8137 +/- ##
===========================================
- Coverage 56.45% 55.37% -1.08%
===========================================
Files 596 596
Lines 91602 91622 +20
===========================================
- Hits 51711 50739 -972
- Misses 39891 40883 +992 ☔ 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.
LGTM
if hasattr(model, "_tied_weights_keys") and model._tied_weights_keys is not None: | ||
for key in model._tied_weights_keys: | ||
expected_keys.remove(key) |
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.
if hasattr(model, "_tied_weights_keys") and model._tied_weights_keys is not None: | |
for key in model._tied_weights_keys: | |
expected_keys.remove(key) | |
if model._keys_to_ignore_on_save is not None: | |
for key in model._keys_to_ignore_on_save: | |
expected_keys.remove(key) |
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.
PaddleNLP/paddlenlp/transformers/model_utils.py
Lines 885 to 886 in 1cd270a
_keys_to_ignore_on_save = None | |
_tied_weights_keys = None |
我们的模型,应该有这个属性
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.
用 _keys_to_ignore_on_save 可能更好一点。
fecf7d8
to
be58295
Compare
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
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
9d87445
to
57476c9
Compare
PR types
Bug fixes
PR changes
Others
Description
Fix tie_weights save and load.