Class ServiceConfig.Hf

java.lang.Object
org.apache.opendal.ServiceConfig.Hf
All Implemented Interfaces:
ServiceConfig
Enclosing interface:
ServiceConfig

public static class ServiceConfig.Hf extends Object implements ServiceConfig
Configuration for service hf.
  • Field Details

    • downloadMode

      public final String downloadMode

      Download mode. Either xet (default) or http.

      When unset, the mode is resolved from the HF_HUB_DISABLE_XET environment variable: a non-empty value forces http, otherwise it defaults to xet. An explicit value here takes precedence.

      See https://huggingface.co/docs/huggingface_hub/package_reference/environment_variables#hfhubdisablexet.

    • enableResolveCache

      public final Boolean enableResolveCache

      Enable caching of resolved HTTP download addresses and XET file metadata.

      Defaults to false. Set to true to share resolve results across readers on the same backend. Changed files may remain invisible while cached results are reused. A reader retains XET metadata from its first read for its lifetime. Create a new reader to resolve the path again when this option is disabled. See [HfBuilder::enable_resolve_cache] for freshness semantics.

    • endpoint

      public final String endpoint

      Endpoint of the Hugging Face Hub.

      The default is https://huggingface.co.

    • repoId

      public final String repoId

      Repo id of this backend.

      This is required.

    • repoType

      public final String repoType

      Repo type of this backend. Required.

    • revision

      public final String revision

      Revision of this backend.

      Default is main.

    • root

      public final String root

      Root of this backend. Can be "/path/to/dir".

      Default is "/".

    • token

      public final String token

      Token of this backend.

      This is optional.

  • Constructor Details

    • Hf

      public Hf()
  • Method Details