Hugging face API for querying models metadata
I aim to conduct an analysis of the top 1000 most downloaded models across each category from the Hugging Face model repository for my academic project, with the objective of optimizing them. Could you advise on how to access metadata for these models, such as model size, number of parameters, model type, upload date, and number of downloads? what is the best way?
2024-02-04T13:34:25Z
Could someone please help?
2024-02-04T14:32:14Z
Hi,You can leverage thehuggingface_hubPython library for that.Refer to the docs:https://huggingface.co/docs/huggingface_hub/guides/search#how-to-list-repositories-.TheModelFilterclass will be useful for you:HfApi Client.Note, things likemodel_typeare only supported for models which are natively supported in the Transformers library.
2024-02-08T11:47:45Z
Thanks@nielsr!! Appreciate your help.