This repository was archived by the owner on Jun 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -75,18 +75,20 @@ def __init__(
7575 self .apply_checkpoint_structure (train_mode , epoch , one_shot )
7676
7777 def state_dict (self , final_epoch ):
78- if self .enabled or self .checkpoint_manager :
79- compose_recipes = self .checkpoint_manager and self .enabled and final_epoch
80- return {
81- 'checkpoint_recipe' : str (ScheduledModifierManager .compose_staged (self .checkpoint_manager , self .manager ))
82- if compose_recipes else str (self .checkpoint_manager ),
83- 'train_recipe' : str (self .manager ) if not final_epoch else None
84- }
78+ if self .enabled and final_epoch :
79+ checkpoint_recipe = (
80+ str (ScheduledModifierManager .compose_staged (self .checkpoint_manager , self .manager ))
81+ if self .checkpoint_manager else str (self .manager )
82+ )
83+ train_recipe = None
8584 else :
86- return {
87- 'checkpoint_recipe' : None ,
88- 'train_recipe' : None
89- }
85+ checkpoint_recipe = str (self .checkpoint_manager ) if self .checkpoint_manager else None
86+ train_recipe = str (self .manager ) if self .manager else None
87+
88+ return {
89+ 'checkpoint_recipe' : checkpoint_recipe ,
90+ 'train_recipe' : train_recipe
91+ }
9092
9193 def apply_checkpoint_structure (self , train_mode , epoch , one_shot = False ):
9294 if self .checkpoint_manager :
You can’t perform that action at this time.
0 commit comments