Skip to contents

Set or update your Hugging Face API token for authentication. The token can be obtained from https://huggingface.co/settings/tokens

Usage

hf_set_token(token = NULL, store = FALSE)

Arguments

token

Character string containing your HF token, or NULL to set interactively. If NULL, will prompt for token input (not echoed to console).

store

Logical. If TRUE, stores the token in .Renviron for future sessions. Default: FALSE (token only available for current session).

Value

Invisibly returns TRUE if token was set successfully.

Examples

if (FALSE) { # \dontrun{
# Set token for current session only
hf_set_token("hf_xxxxxxxxxxxxx")

# Set token interactively and store permanently
hf_set_token(store = TRUE)
} # }