Skip to content

Commit 5965720

Browse files
committed
polish code
1 parent 5e5ca89 commit 5965720

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

paddlenlp/trainer/utils/sharding_io.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -600,11 +600,7 @@ def reshard_sharding(node_model_state):
600600

601601
node_model_state = load_model_slices()
602602
node_model_state = reshard_pp(node_model_state)
603-
opt_state = reshard_sharding(node_model_state)
604-
if self.is_ema:
605-
return {"master_weights": opt_state.get("master_weights", {})}
606-
else:
607-
return opt_state
603+
return reshard_sharding(node_model_state)
608604

609605
def manipulate_state_dict_and_config(self, model_to_save, merge_tensor_parallel=False, state_dict=None):
610606
weight_name_suffix = self.args.sharded_name_suffix()

0 commit comments

Comments
 (0)