To download a specific GGUF model from Hugging Face, you can use one of the following methods depending on the tools you have available. The term hf-xet is not a standard tool, so I'll cover common approaches:
Method 1: Using Hugging Face CLI
-
Install the CLI:
pip install huggingface_hub
-
Log in to Hugging Face (required for gated models like Llama 2):
huggingface-cli login
Follow the prompts to enter your Hugging Face token.
-
Download the GGUF File:
Use the huggingface-cli download command with the repository ID and filename:
huggingface-cli download <REPO_ID> <FILENAME>
Example for a Llama 2 GGUF model:
huggingface-cli download TheBloke/Llama-2-7B-GGUF llama-2-7b.Q4_K_M.gguf
Method 2: Using Git LFS
-
Install Git LFS:
-
Clone the Repository:
git lfs install
git clone https://huggingface.co/<REPO_ID>
Example:
git clone https://huggingface.co/TheBloke/Llama-2-7B-GGUF
-
Navigate to the Downloaded Folder:
cd Llama-2-7B-GGUF
Find the GGUF file in the directory.
Method 3: Using Python Code
Use the huggingface_hub library to programmatically download the file:
from huggingface_hub import hf_hub_download
model_id = "TheBloke/Llama-2-7B-GGUF"
filename = "llama-2-7b.Q4_K_M.gguf"
# Download to current directory
hf_hub_download(repo_id=model_id, filename=filename, local_dir="./models")
Notes:
- Replace
<REPO_ID> with the model's Hugging Face repository ID (e.g., TheBloke/Llama-2-7B-GGUF).
- Replace
<FILENAME> with the exact GGUF filename (check the model page on Hugging Face).
- For gated models (like Llama 2), ensure you have accepted the license terms on the Hugging Face model page.
If you meant a different tool (e.g., XetHub's xet CLI), clarify, and I can adjust the steps!