Skip to content

Commit

Permalink
✨Enhanced before_summary
Browse files Browse the repository at this point in the history
  • Loading branch information
carefree0910 committed Jan 20, 2025
1 parent d9de2f8 commit 87d765a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/learn/callbacks/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def before_summary(self, trainer: ITrainer) -> None:
exclude = finetune_config.get("exclude", "")
exclude_names: List[str]
if not exclude:
strict = finetune_config.get("strict", True)
exclude_names = []
model.load_state_dict(states)
else:
exclude_names = []
for name in states.keys():
Expand All @@ -93,7 +93,7 @@ def before_summary(self, trainer: ITrainer) -> None:
)
states = {k: v for k, v in states.items() if k not in exclude_names}
strict = finetune_config.get("strict", False)
model.load_state_dict(states, strict=strict)
model.load_state_dict(states, strict=strict)
freeze = finetune_config.get("freeze", "")
freeze_except = finetune_config.get("freeze_except", "")
if freeze or freeze_except:
Expand Down

0 comments on commit 87d765a

Please sign in to comment.