Skip to content

Commit

Permalink
remove dirpath's forward slash in TSS (pytorch#596)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: pytorch#596

Reviewed By: galrotem

Differential Revision: D50664943

fbshipit-source-id: bc1430e972cadd2d09abf4306192b513cf372dd6
  • Loading branch information
JKSenthil authored and facebook-github-bot committed Oct 26, 2023
1 parent f8fb8da commit a748cb1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions torchtnt/framework/callbacks/torchsnapshot_saver.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,11 @@ def get_latest_checkpoint_path(


def _latest_checkpoint_path(dirpath: str) -> Optional[str]:
if dirpath[-1] == "/":
# removes trailing forward slash if present
# required for regex search to work
dirpath = dirpath[:-1]

fs = get_filesystem(dirpath)

if not fs.exists(dirpath):
Expand Down

0 comments on commit a748cb1

Please sign in to comment.