Huggingface
🤗

Huggingface

The huggingface_hub Python package comes with a built-in CLI called huggingface-cli. This tool allows you to interact with the Hugging Face Hub directly from a terminal.
For example, you can login to your account, create a repository, upload and download files, etc. It also comes with handy features to configure your machine or manage your cache. In this guide, we will have a look at the main features of the CLI and how to use them.

Parameters

 
# first of all, install the CLI pip install -U "huggingface_hub[cli]" # once installed, you can check that the CLI is correctly setup: huggingface-cli --help # must be logged in to huggingface account before interact with the hub huggingface-cli login # download a single file/multiple files huggingface-cli download gpt2 config.json (model.safetensors) (--resume) # download an entire repository huggingface-cli download meta-llama/Meta-Llama-3-8B (--resume) # download a dataset or a Space # https://huggingface.co/datasets/HuggingFaceH4/ultrachat_200k (--resume) huggingface-cli download HuggingFaceH4/ultrachat_200k --repo-type dataset (--resume) # https://huggingface.co/spaces/HuggingFaceH4/zephyr-chat huggingface-cli download HuggingFaceH4/zephyr-chat --repo-type space (--resume)
 
Â