Skip to content

Commit

Permalink
Merge pull request #402 from allenai/shanea/storage-cleaner-is-run-im…
Browse files Browse the repository at this point in the history
…provement

[Storage cleaner] Mark folders with config.yaml and wandb/ as runs
  • Loading branch information
2015aroras authored Dec 15, 2023
2 parents 75d6738 + e8cd39f commit 5bdccc3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/storage_cleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,10 +649,14 @@ def _is_run(directory: str, run_entries: Optional[List[str]] = None) -> bool:
This method is best effort. It may mark run paths as not (false negatives) or mark non-run
paths as runs (false positives). We prioritize minimizing false positives.
"""
storage = _get_storage_adapter_for_path(directory)
if run_entries is None:
storage = _get_storage_adapter_for_path(directory)
run_entries = storage.list_entries(directory)

if CONFIG_YAML in run_entries and storage.is_dir(os.path.join(directory, "wandb")):
# A directory with both config.yaml and a wandb subdirectory is most likely a run
return True

return _contains_checkpoint_dir(run_entries)


Expand Down

0 comments on commit 5bdccc3

Please sign in to comment.