def _get_cache_dir()

in src/kernels/utils.py [0:0]


def _get_cache_dir() -> Optional[str]:
    """Returns the kernels cache directory."""
    cache_dir = os.environ.get("HF_KERNELS_CACHE", None)
    if cache_dir is not None:
        logging.warning(
            "HF_KERNELS_CACHE will be removed in the future, use KERNELS_CACHE instead"
        )
        return cache_dir

    return os.environ.get("KERNELS_CACHE", None)