HfHub.Config (HfHub v0.2.0)

Copy Markdown View Source

Configuration utilities for HfHub.

Provides functions to access and manage configuration settings.

Summary

Functions

Gets the cache directory path.

Gets cache options.

Gets the HuggingFace Hub endpoint URL.

Gets HTTP client options.

Functions

cache_dir()

@spec cache_dir() :: Path.t()

Gets the cache directory path.

Checks in order:

  1. Application configuration
  2. HF_HUB_CACHE environment variable
  3. HF_HOME environment variable
  4. Default: "~/.cache/huggingface"

Examples

cache_dir = HfHub.Config.cache_dir()
# => "/home/user/.cache/huggingface"

cache_opts()

@spec cache_opts() :: keyword()

Gets cache options.

Examples

opts = HfHub.Config.cache_opts()

endpoint()

@spec endpoint() :: String.t()

Gets the HuggingFace Hub endpoint URL.

Defaults to "https://huggingface.co".

Examples

endpoint = HfHub.Config.endpoint()
# => "https://huggingface.co"

http_opts()

@spec http_opts() :: keyword()

Gets HTTP client options.

Examples

opts = HfHub.Config.http_opts()