Skip to main content

hf_cache_dir

Function hf_cache_dir 

Source
pub fn hf_cache_dir() -> Result<PathBuf, FetchError>
Expand description

Returns the HuggingFace Hub cache directory.

Resolution order:

  1. HF_HOME environment variable + /hub
  2. ~/.cache/huggingface/hub/ (via dirs::home_dir())

§Errors

Returns FetchError::Io if the home directory cannot be determined.