diff --git a/src/olmo_core/distributed/checkpoint/__init__.py b/src/olmo_core/distributed/checkpoint/__init__.py index 44909785..f5821e62 100644 --- a/src/olmo_core/distributed/checkpoint/__init__.py +++ b/src/olmo_core/distributed/checkpoint/__init__.py @@ -584,8 +584,9 @@ def get_checkpoint_metadata(dir: PathOrStr) -> Metadata: return storage_reader.read_metadata() except FileNotFoundError as exc: msg = f"'{dir}' does not appear to contain a state dict checkpoint." - if file_exists((suggested_path := join_path(dir, "model_and_optim/.metadata"))): - msg += f" Did you mean to use '{suggested_path}'?" + suggested_dir = join_path(dir, "model_and_optim") + if file_exists(join_path(suggested_dir, ".metadata")): + msg += f" Did you mean to use '{suggested_dir}'?" raise FileNotFoundError(msg) from exc