$ pip install -U "huggingface_hub[cli]"
First, create a token from Hugging Face Settings (Permission: write).
$ huggingface-cli login
- Add token as git credential? --> n
If you encounter huggingface-cli: command not found
: ref
$ echo "export PATH=\"`python3 -m site --user-base`/bin:\$PATH\"" >> ~/.bashrc
$ source ~/.bashrc
Then retry huggingface-cli login
. It should work now.
$ huggingface-cli logout
$ huggingface-cli download {repo ID} --local-dir {local path}
--include
: e.g., --include "*.json" "*.safetensors"
--exclude
: e.g., --exclude "*.bin"
$ huggingface-cli download {repo ID} {file name} --local-dir {local path}