Skip to content

Commit

Permalink
Update unified_checkpoint.py
Browse files Browse the repository at this point in the history
  • Loading branch information
DesmonDay authored Dec 20, 2024
1 parent 297dbce commit 3c0059e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion paddlenlp/trainer/unified_checkpoint/unified_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,10 @@ def load_unified_optimizer(self, model, optimizer, resume_from_checkpoint):
os.path.join(resume_from_checkpoint, SAFE_OPTIMIZER_INDEX_NAME)
)
if has_merge_optimizer_safetensors:
with open(os.path.join(resume_from_checkpoint, SAFE_OPTIMIZER_INDEX_NAME), "r") as f:
optimizer_index_file = os.path.join(resume_from_checkpoint, SAFE_OPTIMIZER_INDEX_NAME)
if distributed_isfile(optimizer_index_file):
distributed_file(optimizer_index_file)
with open(optimizer_index_file, "r") as f:

Check warning on line 441 in paddlenlp/trainer/unified_checkpoint/unified_checkpoint.py

View check run for this annotation

Codecov / codecov/patch

paddlenlp/trainer/unified_checkpoint/unified_checkpoint.py#L438-L441

Added lines #L438 - L441 were not covered by tests
index = json.loads(f.read())

# get quant ckpt info `ckpt_quant_stage` and `quant_ckpt_resume_times`
Expand Down

0 comments on commit 3c0059e

Please sign in to comment.