Configure Hugging Face SDK to Work With Artifactory

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide
ft:sourceType
Paligo

This topic describes how to configure Hugging Face SDK to work with Artifactory.

To configure the Hugging Face SDK to work with Artifactory:

  1. Go to the JFrog Platform Artifacts page, select your Hugging Face repository, and click Set Me Up.

  2. To create a Hugging Face token, enter your JFrog Platform password, and click Generate Token & Create Instructions.

  3. Connect your HuggingFaceML repository to the Hugging Face SDK in Artifactory using the following command:

    export HF_HUB_ETAG_TIMEOUT=86400
    export HF_HUB_DOWNLOAD_TIMEOUT=86400 
    export HF_ENDPOINT=https://<YOUR_JFROG_DOMAIN>/artifactory/api/huggingfaceml/<REPOSITORY_NAME>

    For example:

    export HF_HUB_ETAG_TIMEOUT=86400
    export HF_HUB_DOWNLOAD_TIMEOUT=86400
    export HF_ENDPOINT=https://john.jfrog.io/artifactory/api/huggingfaceml/john_HF_local
    
  4. Authenticate the Hugging Face client with Artifactory by running the following command:

    export HF_TOKEN=<IDENTITY_TOKEN>

    For example:

    export HF_TOKEN=ZdtdKiLgbgprmkLrUXyjD0uCGI!HN7ZywzZ55JCAwpHhTZsOr7Uv-L7oeCKZ3y