Skip to content

Commit

Permalink
feat: not failing if the ckpt folder does not exist yet
Browse files Browse the repository at this point in the history
  • Loading branch information
samsja committed Aug 23, 2024
1 parent 49bfa9b commit bb49d16
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion open_diloco/ckpt_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ def get_resume_info(ckpt_config: CkptConfig) -> tuple[bool, str | None]:
elif isinstance(ckpt_config.resume, bool):
# Using fsspec to list directory contents
fs = GenericFileSystem()
ckpt_files = [f for f in fs.ls(ckpt_config.path, detail=False) if filter_ckpt_files(f)]
try:
ckpt_files = [f for f in fs.ls(ckpt_config.path, detail=False) if filter_ckpt_files(f)]
except FileNotFoundError:
logger.info(f"Checkpoint path {ckpt_config.path} not found, starting from scratch")
return False, None

if len(ckpt_files) == 0:
logger.info(f"No checkpoints found in {ckpt_config.path}, starting from scratch")
Expand Down

0 comments on commit bb49d16

Please sign in to comment.