Page cover image

Downloading models

General Introduction

We can download the model to our local host from the Huggingface Model Hub.

If you are unfamiliar with the Huggingface Model Hub, the Youtube video below provides a rundown.

Worth watching despite the moustache
Summary of Huggingface Model Hub

Navigating the Hugging Face Model Hub:

  1. Access the model hub by clicking on the "Models" tab in the upper right corner of the Hugging Face landing page.

  2. The model hub interface is divided into several parts:

    • Left side: Categories for tailoring model search

      • Tasks: Various tasks such as NLP, computer vision, and speech recognition

      • Libraries: Model backbones (PyTorch, TensorFlow, JAX) and high-level frameworks (transformers, etc.)

      • Datasets: Filter models trained on specific datasets

      • Languages: Filter models that handle selected languages

      • License: Choose the license under which the model is shared

    • Right side: Available models on the hub, ordered by downloads by default

  3. Clicking on a model opens its model card, which contains crucial information:

    • Description, intended use, limitations, and biases

    • Code snippets for model usage

    • Training procedure, data processing, evaluation results, and copyrights

    • Inference API on the right for testing the model with user inputs

    The "Files and versions" tab displays the model repositories' architecture, branches, commit history.

The Model Card

Model cards are files that accompany the models and provide handy information.

Under the hood, model cards are simple Markdown files with additional metadata.

Model cards are essential for discoverability, reproducibility, and sharing. You can find a model card as the README.md file in any model repository.

The model card should describe:

  • the model

  • its intended uses and potential limitations, including biases and ethical considerations

  • the training parameters and experimental info

  • which datasets were used to train your model

  • the model’s evaluation results

Downloading Models from Hugging Face Hub

The Hugging Face Hub provides several ways to download and use models, depending on your requirements and the tools you are using. This documentation will guide you through the different methods available.

Using Git

All models on the Model Hub are stored as Git repositories, which means you can clone them locally using Git commands. To clone a model, follow these steps:

If you have not already, install Git LFS (Large File Storage) by running:

git lfs install

Clone the model repository using the following command:

git clone [email protected]:<MODEL ID>

Replace <MODEL ID> with the actual model ID. For example:

git clone [email protected]:bigscience/bloom

If you have write access to a particular model repository, you can also commit and push revisions to the model.

By following these methods, you can easily download and use models from the Hugging Face Hub in your projects, whether you're using integrated libraries, the Hugging Face Client Library, or Git directly.

Last updated

Was this helpful?