| hf_set_token | R Documentation |
Set or update your Hugging Face API token for authentication. The token is written to the 'HF_TOKEN' environment variable used by current Hugging Face tooling, and mirrored to the legacy 'HUGGING_FACE_HUB_TOKEN' name.
hf_set_token(token = NULL, store = FALSE)
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). |
Inference calls require a token with the "Make calls to Inference Providers" permission. See https://huggingface.co/docs/hub/security-tokens for token setup.
Invisibly returns TRUE if token was set successfully.
## Not run:
# Set token for current session only
hf_set_token("hf_xxxxxxxxxxxxx")
# Set token interactively and store permanently
hf_set_token(store = TRUE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.