MCPcopy Create free account
hub / github.com/eric-mitchell/direct-preference-optimization / get_local_run_dir

Function get_local_run_dir

utils.py:55–61  ·  view source on GitHub ↗

Create a local directory to store outputs for this run, and return its path.

(exp_name: str, local_dirs: List[str])

Source from the content-addressed store, hash-verified

53
54
55def get_local_run_dir(exp_name: str, local_dirs: List[str]) -> str:
56 """Create a local directory to store outputs for this run, and return its path."""
57 now = datetime.now()
58 timestamp = now.strftime("%Y-%m-%d_%H-%M-%S_%f")
59 run_dir = f"{get_local_dir(local_dirs)}/{exp_name}_{timestamp}"
60 os.makedirs(run_dir, exist_ok=True)
61 return run_dir
62
63
64def slice_and_move_batch_for_device(batch: Dict, rank: int, world_size: int, device: str) -> Dict:

Callers 1

train.pyFile · 0.90

Calls 1

get_local_dirFunction · 0.85

Tested by

no test coverage detected