How to download Huggingface models on Linux

This page provides a detailed guide on how to download HuggingFace models on a Linux system using HFDownloader. This compact yet powerful tool simplifies the process of retrieving models, datasets, and training scripts from HuggingFace repositories, allowing researchers and developers to work seamlessly with AI resources.

Download HFDownloader

Download the executable: HFDownload
Download as a zip: HFDownload.zip
Download the source:HFDownloader-src.zip

What is HFDownloader?

HFDownloader is a simple and compact, but powerful tool for downloading files from HuggingFace repositories conveniently. It is a single executable file, it does not require any installation procedure. It has no dependencies.

The HFDownload executable can be run from the shell, and the files to be downloaded can be passed as a command line parameter. The specified files are processed by HFDownloader and downloaded from HuggingFace.co. The downloaded files are then verified to ensure they are intact.

What is a HuggingFace repository?

A HuggingFace repository is a collection of pre-trained models, datasets, and training scripts. These repositories enable researchers and developers to share, collaborate, and fine-tune models for tasks like text generation, translation, and image processing. Hugging Face repositories are structured similarly to GitHub, supporting version control, discussions, and community contributions.

How to use HFDownloader in Linux (Quick Steps)

  1. Download HFDownload.exe
  2. Add execute permission to HFDownload
  3. Download Huggingface repository to AIModels folder
  4. Enable download
  5. Downloading process
  6. Download finished
  7. Files in AIModels folder

How to use HFDownloader in Linux (Video tutorial)

In this video, you will learn how to use HFDownloader on a Linux system to easily download models and files from HuggingFace repositories. This step-by-step tutorial will guide you through the entire process, from downloading the HFDownloader file to successfully retrieving files from HuggingFace.

Step 1 - Download HFDownload.exe

First step, download HFDownloader from this link (Figure 1).

Download HFDownload file
Figure 1 - Download HFDownload file

Step 2 - Add execute permission to HFDownload

Before you can run HFDownloader on Linux, you need to grant it execute permission. To do this, open your terminal and enter the command (Figure 2).

chmod +x HFDownload

Add execute permission to HFDownload
Figure 2 - Add execute permission to HFDownload

Step 3 - Download Huggingface repository to AIModels folder

You can download the files with the following command. First the name of the downloaded file, then the link to the model you want to download (Figure 3).

./HFDownload https://huggingface.co/vivek-dodia/Deepseek-R1-8B-MK-Distilled -o AIModels

Download Huggingface fepository to AIModels folder
Figure 3 - Download Huggingface repository to AIModels folder

Step 4 - Enable download

Before starting the download, the command line will tell you how many files it will download, how much space it needs, how much free space you have and will have, and then ask you if you want to continue. To continue, type a "Y" (Figure 4).

Enable download
Figure 4 - Enable download

Step 5 - Downloading process

You can see the download status. The files that are being downloaded and those that are already downloaded (Figure 5).

Downloading process
Figure 5 - Downloading process

Step 6 - Download finished

After all files have been downloaded, you will receive the following message "HFDownloader ran successfully." (Figure 6).

Download finished
Figure 6 - Download finished

Step 7 - Files in AIModels folder

Navigate to the directory of the downloaded file and use the "ls" command to list the downloaded files (Figure 7).

Files in AIModels folder
Figure 7 - Files in AIModels folder

More information