Resolve Hugging Face Models using Libraries

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide
ft:sourceType
Paligo

Artifactory supports resolving specific models and related files using libraries like Transformers and Diffusers, among others.

Note

Resolving Hugging Face models using libraries is only supported from Artifactory version 7.77 and above, Hugging Face client version 0.19.0 and above, and with the HF_HUB_ETAG_TIMEOUT parameter enabled. Otherwise, use snapshot download to resolve whole model repositories.

In the following example, we will use the Transformers library to download a model called Llama-2-7b-chat-hf using artifactory. Transformers is the library supported by this model: note that other models might have different library options.

For example, to resolve the Llama-2-7b-chat-hf model from an Artifactory repository using Transformers:

  1. Go to the model page on Hugging Face Hub and click </> Use in Transformers on the top right side of the screen.

    HF_use_in_transformers.png
  2. Click Copy next to the command you want to use

    HF_copy.png
  3. Run the command in your code to resolve the model