Skip to main content

Module file_selection

Module file_selection 

Source
Expand description

Choosing which files of a Hugging Face repo to download. A repo lists many siblings; this picks the model weights (preferring one GGUF quantization, or the safetensors set, dropping duplicate/converted formats) plus the small companion config/tokenizer files, and drops docs, images, and non-model directories.

Structs§

HFSibling
One file listed in a Hugging Face repo, as returned by the hub API.

Functions§

file_extension
The lowercased extension of path (the part after the last .), or empty when there is none or the only dot is a leading one (a dotfile has no extension).
is_weight_path
Whether path’s extension marks it a model weight file.
select
Select the files to download from a repo’s siblings: the eligible weights (one GGUF quant group, or the safetensors/pytorch set) plus small companions.