MCPcopy Index your code
hub / github.com/eric-mitchell/direct-preference-optimization / get_local_dir

Function get_local_dir

utils.py:46–52  ·  view source on GitHub ↗

Return the path to the cache directory for this user.

(prefixes_to_resolve: List[str])

Source from the content-addressed store, hash-verified

44
45
46def get_local_dir(prefixes_to_resolve: List[str]) -> str:
47 """Return the path to the cache directory for this user."""
48 for prefix in prefixes_to_resolve:
49 if os.path.exists(prefix):
50 return f"{prefix}/{getpass.getuser()}"
51 os.makedirs(prefix)
52 return f"{prefix}/{getpass.getuser()}"
53
54
55def get_local_run_dir(exp_name: str, local_dirs: List[str]) -> str:

Callers 4

__init__Method · 0.90
worker_mainFunction · 0.90
mainFunction · 0.90
get_local_run_dirFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected