HuggingFaceModelDownloader icon indicating copy to clipboard operation
HuggingFaceModelDownloader copied to clipboard

[Feature Request] Filter by filetypes?

Open d8ahazard opened this issue 2 years ago • 3 comments

Hey there! Great utility! It's so nice not having to code something up in python to get similar behavior to the hf_hub_download function.

One request I have, however, would be the ability to filter by model filetype.

Or, heck, maybe this already exists, and I'm mis-understanding how the filtering works.

For example:

If downloading from stabilityai/stable-diffusion-xl-base-1.0, they have a myriad of different model types/weights/etc.

But, for my purposes, I really only care about the .json and .safetensors files - and even then, only the ones in subdirectories.

While I know the latter part would probably make things get super-complicated, I feel like being able to only pull down .safetensors and .json files would be a bit easier to implement?

Or, if the functionality is already there...could you kindly let me know how to filter this way?

Much appreciated.

d8ahazard avatar Dec 30 '23 16:12 d8ahazard

Hi, for me this is already working (at least partially) by using

/hfdownloader -m "model-name:-of-00008.safetensors,tokenizer.model"

this skipps all .bin .act and .model files But a more capable filtering would be nice. something like --include "*.safetensors,tokenizer.model,*.json" and an exclude maybe mutually exclusive would be nice. Or even --include-regex but that might go a bit far.

nylocx avatar Jan 12 '24 13:01 nylocx

to properly implement this, we need to add new filter type by extension I'll think about it

bodaay avatar Mar 07 '24 15:03 bodaay

This could be nice as there's multiple versions of the same model which you may never run. like onnx o1 o2 o3 o4 variants, then the pytorch, safetensors, etc.

andersfylling avatar Dec 12 '24 12:12 andersfylling