Skip to main content
Version: devel

dlt.common.configuration.specs.hf_credentials

HfCredentials Objects

@configspec
class HfCredentials(CredentialsConfiguration)

View source on GitHub

Credentials for HF filesystem, compatible with fsspec HF protocol at huggingface_hub.HfFileSystem.

Authentication is attempted in the following order of priority:

  • the hf_token argument
  • the HF_TOKEN environment variable
  • a local token created with the hf auth login command

For more information about parameters: https://huggingface.co/docs/huggingface_hub/en/quick-start#login-command

hf_token

Hugging Face authentication token. Leave empty to attempt authentication through HF_TOKEN environment variable or locally saved token.

hf_endpoint

Hugging Face API endpoint. Leave empty to use the default https://huggingface.co.

to_hffs_credentials

def to_hffs_credentials() -> Dict[str, Any]

View source on GitHub

Return a dict that can be passed to fsspec huggingface_hub.HfFileSystem.

to_hf_api_credentials

def to_hf_api_credentials() -> Dict[str, Any]

View source on GitHub

Return a dict that can be passed to huggingface_hub.HfApi.

This demo works on codespaces. Codespaces is a development environment available for free to anyone with a Github account. You'll be asked to fork the demo repository and from there the README guides you with further steps.
The demo uses the Continue VSCode extension.

Off to codespaces!

DHelp

Ask a question

Welcome to "Codex Central", your next-gen help center, driven by OpenAI's GPT-4 model. It's more than just a forum or a FAQ hub – it's a dynamic knowledge base where coders can find AI-assisted solutions to their pressing problems. With GPT-4's powerful comprehension and predictive abilities, Codex Central provides instantaneous issue resolution, insightful debugging, and personalized guidance. Get your code running smoothly with the unparalleled support at Codex Central - coding help reimagined with AI prowess.