huggingfacehuggingface-hub

how to download huggingface-model files by filtering unwanted files


a huggingface model, like Qwen32B-GGUF, contains some quantization-related files which are large. Perhaps, only use one quantization-related file and the rest is not used.

By huggingface-cli, it supports a way to download a part of files by listing them such as huggingface-cli download Qwen/Qwen3-32B file01 file02. In this case, it is better to configure the unwanted files. Any solution?


Solution

  • You can use huggingface-cli download {{REPO_NAME}} --exclude {{UNWANTED_FILES}} to filter out the files you do not want. For instance, if you wanted to exclude the .txt files from Qwen/Qwen32B. You can use huggingface-cli download Qwen/Qwen32B --exclude *.txt.