Skip to content

Commit

Permalink
Do not raise an error when a temp checkpoint path doesn't exist
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 731451478
  • Loading branch information
Orbax Authors committed Feb 27, 2025
1 parent acec3f3 commit ee96ccc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions checkpoint/orbax/checkpoint/_src/path/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import dataclasses
import datetime
import functools
import os
import re
import time
from typing import Callable, Generic, Iterator, List, Optional, Protocol, Sequence, Set, TypeVar
Expand Down Expand Up @@ -522,6 +523,11 @@ def get_save_directory(
def is_tmp_checkpoint(path: epath.PathLike) -> bool:
"""Determines whether a directory is a tmp checkpoint path."""
path = epath.Path(path)
if os.path.islink(path):
logging.warning(
'Path %s is a symbolic link, not treating it as a tmp checkpoint.', path
)
return False
if not path.exists():
raise ValueError(f'Path {path} does not exist.')
if not path.is_dir():
Expand Down

0 comments on commit ee96ccc

Please sign in to comment.