huggingface / hub-docs

Docs of the Hugging Face Hub

Home Page:http://hf.co/docs/hub

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

API to get huggingface models which are trending

sidgog opened this issue · comments

Is your feature request related to a problem? Please describe.
huggingface has list of models which can be filter on website. for ex. the following URL will list trending models under task text-classification
https://huggingface.co/models?pipeline_tag=text-classification&sort=trending
Similar there should be API as well available to get the list of models sorted by trending.

As of now following API works
https://huggingface.co/api/models?pipeline_tag=text-classification

However, this fails
https://huggingface.co/api/models?pipeline_tag=text-classification&sort=trending

Describe the solution you'd like
.https://huggingface.co/api/models?pipeline_tag=text-classification&sort=trending API call should list the same models as listed in url https://huggingface.co/models?pipeline_tag=text-classification&sort=trending

Describe alternatives you've considered
have considered using this API call https://huggingface.co/api/models?pipeline_tag=text-classification&trending=true
However, it list different models compare to the models available here https://huggingface.co/models?pipeline_tag=text-classification&sort=trending

@sidgog if I'm not mistaken the "trending" sorting is based on likes over the 7 days. You can query them with https://huggingface.co/api/models?sort=likes7d&direction=-1 (which display exactly the same models as https://huggingface.co/models?sort=trending).
FYI, you can also sort by downloads, likes and likes30d if interested.

this worked. Thank you!