Skip to content

hub

Hugging Face Hub file URLs and the token of the environment.

Functions:

  • load_hub_token –

    Return the Hugging Face Hub token of the environment: HF_TOKEN, else the file hf auth login wrote

load_hub_token [source] ΒΆ

load_hub_token() -> Optional[str]

Return the Hugging Face Hub token of the environment: HF_TOKEN, else the file hf auth login wrote (HF_TOKEN_PATH, by default ~/.cache/huggingface/token). The weights of a gated repository download with it.

Returns:

  • Optional[str] –

    The token, or None when none is set.