cache#

Per-user cache directory shared by all ModelOpt packages.

Functions

get_cache_dir

Return ModelOpt's private per-user cache directory (plus subdirs), creating it if needed.

get_cache_dir(*subdirs)#

Return ModelOpt’s private per-user cache directory (plus subdirs), creating it if needed.

That is $XDG_CACHE_HOME/modelopt (~/.cache/modelopt if the variable is unset, empty or relative), created with mode 0700. A directory that another user owns or that group or others can write to is not used, since they could pre-plant or symlink files in it. Neither is an unusable one (no home directory, a directory this user cannot write to, read-only filesystem): a private temp directory, created once per process, takes its place, so callers never fail because of the cache. Store only data that can be regenerated.

Parameters:

subdirs (str)

Return type:

Path