dlt.common.configuration.specs.hf_credentials
HfCredentials Objects
@configspec
class HfCredentials(CredentialsConfiguration)
Credentials for HF filesystem, compatible with fsspec HF protocol at huggingface_hub.HfFileSystem.
Authentication is attempted in the following order of priority:
- the
hf_tokenargument - the
HF_TOKENenvironment variable - a local token created with the
hf auth logincommand
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]
Return a dict that can be passed to fsspec huggingface_hub.HfFileSystem.
to_hf_api_credentials
def to_hf_api_credentials() -> Dict[str, Any]
Return a dict that can be passed to huggingface_hub.HfApi.