Skip to content

Commit

Permalink
Fix checkpoint path in no_trainer scripts (#26733)
Browse files Browse the repository at this point in the history
checkpoint path
  • Loading branch information
muellerzr authored Oct 11, 2023
1 parent 6ecb2ab commit 1d6a847
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def collate_fn(examples):
path = os.path.basename(checkpoint_path)

accelerator.print(f"Resumed from checkpoint: {checkpoint_path}")
accelerator.load_state(path)
accelerator.load_state(checkpoint_path)
# Extract `epoch_{i}` or `step_{i}`
training_difference = os.path.splitext(path)[0]

Expand Down
2 changes: 1 addition & 1 deletion examples/pytorch/image-pretraining/run_mim_no_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ def preprocess_images(examples):
path = os.path.basename(checkpoint_path)

accelerator.print(f"Resumed from checkpoint: {checkpoint_path}")
accelerator.load_state(path)
accelerator.load_state(checkpoint_path)
# Extract `epoch_{i}` or `step_{i}`
training_difference = os.path.splitext(path)[0]

Expand Down
2 changes: 1 addition & 1 deletion examples/pytorch/language-modeling/run_clm_no_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ def group_texts(examples):
path = os.path.basename(checkpoint_path)

accelerator.print(f"Resumed from checkpoint: {checkpoint_path}")
accelerator.load_state(path)
accelerator.load_state(checkpoint_path)
# Extract `epoch_{i}` or `step_{i}`
training_difference = os.path.splitext(path)[0]

Expand Down
2 changes: 1 addition & 1 deletion examples/pytorch/language-modeling/run_mlm_no_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ def group_texts(examples):
path = os.path.basename(checkpoint_path)

accelerator.print(f"Resumed from checkpoint: {checkpoint_path}")
accelerator.load_state(path)
accelerator.load_state(checkpoint_path)
# Extract `epoch_{i}` or `step_{i}`
training_difference = os.path.splitext(path)[0]

Expand Down
2 changes: 1 addition & 1 deletion examples/pytorch/multiple-choice/run_swag_no_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ def preprocess_function(examples):
path = os.path.basename(checkpoint_path)

accelerator.print(f"Resumed from checkpoint: {checkpoint_path}")
accelerator.load_state(path)
accelerator.load_state(checkpoint_path)
# Extract `epoch_{i}` or `step_{i}`
training_difference = os.path.splitext(path)[0]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ def create_and_fill_np_array(start_or_end_logits, dataset, max_len):
path = os.path.basename(checkpoint_path)

accelerator.print(f"Resumed from checkpoint: {checkpoint_path}")
accelerator.load_state(path)
accelerator.load_state(checkpoint_path)
# Extract `epoch_{i}` or `step_{i}`
training_difference = os.path.splitext(path)[0]

Expand Down
2 changes: 1 addition & 1 deletion examples/pytorch/question-answering/run_qa_no_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ def create_and_fill_np_array(start_or_end_logits, dataset, max_len):
path = os.path.basename(checkpoint_path)

accelerator.print(f"Resumed from checkpoint: {checkpoint_path}")
accelerator.load_state(path)
accelerator.load_state(checkpoint_path)
# Extract `epoch_{i}` or `step_{i}`
training_difference = os.path.splitext(path)[0]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ def preprocess_val(example_batch):
path = os.path.basename(checkpoint_path)

accelerator.print(f"Resumed from checkpoint: {checkpoint_path}")
accelerator.load_state(path)
accelerator.load_state(checkpoint_path)
# Extract `epoch_{i}` or `step_{i}`
training_difference = os.path.splitext(path)[0]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ def postprocess_text(preds, labels):
path = os.path.basename(checkpoint_path)

accelerator.print(f"Resumed from checkpoint: {checkpoint_path}")
accelerator.load_state(path)
accelerator.load_state(checkpoint_path)
# Extract `epoch_{i}` or `step_{i}`
training_difference = os.path.splitext(path)[0]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ def preprocess_function(examples):
path = os.path.basename(checkpoint_path)

accelerator.print(f"Resumed from checkpoint: {checkpoint_path}")
accelerator.load_state(path)
accelerator.load_state(checkpoint_path)
# Extract `epoch_{i}` or `step_{i}`
training_difference = os.path.splitext(path)[0]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ def compute_metrics():
path = os.path.basename(checkpoint_path)

accelerator.print(f"Resumed from checkpoint: {checkpoint_path}")
accelerator.load_state(path)
accelerator.load_state(checkpoint_path)
# Extract `epoch_{i}` or `step_{i}`
training_difference = os.path.splitext(path)[0]

Expand Down
2 changes: 1 addition & 1 deletion examples/pytorch/translation/run_translation_no_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ def postprocess_text(preds, labels):
path = os.path.basename(checkpoint_path)

accelerator.print(f"Resumed from checkpoint: {checkpoint_path}")
accelerator.load_state(path)
accelerator.load_state(checkpoint_path)
# Extract `epoch_{i}` or `step_{i}`
training_difference = os.path.splitext(path)[0]

Expand Down

0 comments on commit 1d6a847

Please sign in to comment.