Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

load checkpoint without extra state #222

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pytorch_translate/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@ def setup_training_state(args, trainer, task):
# ignore previous directory args and just use the absolute path as is.
checkpoint_path = os.path.join(args.save_dir, args.restore_file)
restore_state = True
if os.path.exists(checkpoint_path):
if os.path.isfile(checkpoint_path):
print(
f"| Using --save-dir={args.save_dir}, --restore-file={args.restore_file}."
)
elif args.pretrained_checkpoint_file and os.path.exists(
elif args.pretrained_checkpoint_file and os.path.isfile(
args.pretrained_checkpoint_file
):
checkpoint_path = args.pretrained_checkpoint_file
Expand Down