Connect the Hugging Face SDK to Artifactory to deploy and resolve packages from Artifactory repositories.
Prerequisite: Before connecting the Hugging Face SDK to Artifactory, you must have an existing Hugging Face repository in Artifactory. For more information, see Create a Hugging Face Repository.
Logged in vs. Anonymous User: You can work with Hugging Face and Artifactory as a logged-in user or anonymously. To work with Artifactory using Anonymous Access, configure that access under Admin | Security | General. For details, refer to Allow Anonymous Access.
To connect the Hugging Face SDK to Artifactory:
Run the following command to add the Artifactory repository to your Hugging Face SDK:
export HF_HUB_ETAG_TIMEOUT=86400 export HF_HUB_DOWNLOAD_TIMEOUT=86400 export HF_ENDPOINT=https://[JFrogPlatformURL]/artifactory/api/huggingfaceml/<REPO_NAME>Where:
[JFrogPlatformURL]: The URL of your JPD<REPO_NAME>: The name of the target repository in Artifactory
For example:
export HF_HUB_ETAG_TIMEOUT=86400 export HF_HUB_DOWNLOAD_TIMEOUT=86400 export HF_ENDPOINT=https://company.jfrog.io/artifactory/api/huggingfaceml/huggingface-localRun the following command to authenticate the Hugging Face SDK to Artifactory:
export HF_TOKEN=<TOKEN>
Where:
<TOKEN>: Your Artifactory identity token
For example:
export HF_TOKEN=ajK2m4p6N8r9TbuFvWxYz1C3E5G7H9JtywzZ55JCAwpHhTZsOr7Uv-L7oeCKZ3y
Note
You can also use JFrog Set me up to copy the snippet populated with your token and environment. For more information, see Use Artifactory Set Me Up for Configuring Package Manager Clients.
Next steps: