huggingface / huggingface.js

Utilities to use the Hugging Face Hub API
https://hf.co/docs/huggingface.js
MIT License
1.35k stars 197 forks source link

[Feature Request] Model inspector for other formats #578

Open madgetr opened 5 months ago

madgetr commented 5 months ago

Is there a plan to add model inspector support for other model formats? Currently, it seems that only safetensors and GGUF are supported. image I know that these other formats are not easily analyzed without the entire file on hand, but perhaps the tensor shapes and model metadata could be extracted on your backend at the same time as pickle and virus scanning.

julien-c commented 5 months ago

@madgetr which formats are you looking for? the reason why we implemented for GGUF and Safetensors (in addition to the fact that's it doable over the network, like you mention) are because those are safe unlike pytorch pickles, so we encourage their use

madgetr commented 5 months ago

I was thinking it would be interesting if you could see this data for the various other formats floating around such as pytorch, onnx, flax etc.

julien-c commented 5 months ago

onnx might be doable (it's protobuf based IIRC). The others i'm not so keen bc they're unsafe formats so we want to push users away from those anyways

madgetr commented 5 months ago

Thanks :)