Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def main() -> None:
prefetch_assets(config)

# Set up the run directory (so the SLURM script can reference it).
run_dir = setup_run_directory(config)
run_dir = setup_run_directory(config, allow_override=True)
logger.info("Run directory: %s", run_dir)

if not confirmed:
Expand Down
11 changes: 8 additions & 3 deletions src/post_training/utils/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def generate_run_name(config: PostTrainingConfig) -> str:
return get_backend(config.backend).generate_run_name(config, timestamp)


def setup_run_directory(config: PostTrainingConfig) -> Path:
def setup_run_directory(config: PostTrainingConfig, allow_override: bool = False) -> Path:
"""Create the run output directory tree and return the run root.

Directory layout::
Expand All @@ -58,8 +58,13 @@ def setup_run_directory(config: PostTrainingConfig) -> Path:

run_dir = base / run_name

# Handle debug override.
if config.debug.enabled and config.debug.override_existing and run_dir.exists():
# Handle debug override — only when submit.py explicitly opts in.
if (
allow_override
and config.debug.enabled
and config.debug.override_existing
and run_dir.exists()
):
shutil.rmtree(run_dir)

from post_training.backend import get_backend
Expand Down
Loading