[Shorts-1] How to download HuggingFace models the right way

1 minute read

While downloading HuggingFace may seem trivial, I found that a few in my circle couldn’t figure how to download huggingface-models. There are others who download it using the “download” link but they’d lose out on the model versioning support by HuggingFace. This micro-blog/post is for them.


Figure 1: HuggingFace landing page
  • Select a model. For now, let’s select bert-base-uncased
Figure 2: HuggingFace models page
  • You just have to copy the model link. In our case, https://huggingface.co/bert-base-uncased

Note: Model versioning is done here with the help of GitLFS (Git for Large File Storage). If you haven’t already installed it, install it from here.

  1. Navigate to the directory you want.
  2. Type the following commands:
    git lfs install # Initiate the git LFS system
    git clone https://huggingface.co/bert-base-uncased

That’s it. Your model will be downloaded like a git code repo.

Leave a comment