Hugging Face Downloader in Python using HF Hub
A dirty simple downloader with a few command line args. Default download dir is ./models, if it's not there it'll create it.
I spit this code out in about 15 mins including reading HF docs, I'll try to clean it up soon.
git clone https://github.com/nathanodle/hfdl.git
cd hdfl
python -m venv venv
source venv/bin/activate
pip install argparse huggingface_hub
source venv/bin/activate (if you haven't already)
python hfdl.py
hfdl.py [-h] [--model_dir MODEL_DIR] [--gguf_quant GGUF_QUANT] [--branch BRANCH] [MODEL]
Download model from HF.
positional arguments:
MODEL model to download in format PUBLISHER/REPO
options:
-h, --help show this help message and exit
--model_dir MODEL_DIR
Directory to store models in. Default: ./models
--gguf_quant GGUF_QUANT
quant to retrieve, like Q6_K
--branch BRANCH branch to download
python3 hfdl.py TheBloke/neural-chat-7B-v3-3-GGUF --gguf_quant Q8_0
python3 hfdl.py argilla/notux-8x7b-v1
python3 hfdl.py TheBloke/OpenHermes-2.5-Mistral-7B-GPTQ --branch gptq-8bit-32g-actorder_True
python3 hfdl.py microsoft/phi-2 --model_dir /home/user/models