huggingface_hub icon indicating copy to clipboard operation
huggingface_hub copied to clipboard

Request for Detailed Download Statistics in Hub API Endpoints

Open yachty66 opened this issue 2 years ago • 10 comments

Is your feature request related to a problem? Please describe.

I am currently working on implementing trending models for Hugging Face models (https://github.com/yachty66/trending_huggingface), similar to what is provided on GitHub's trending page (https://github.com/trending). However, I'm facing difficulties as the current Hub API Endpoints' list_models() method only provides the number of downloads from the last month. It lacks more granular, frequent statistics that would allow for real-time or at least daily tracking of model download counts.

Describe the solution you'd like

I would greatly appreciate it if the API could provide more detailed download statistics. For example, it would be extremely helpful to have data on how often a model was downloaded on a daily basis. Real-time statistics would be even better, if feasible.

Describe alternatives you've considered

As an alternative, I considered using the provided monthly download count to estimate daily downloads, but this does not provide the accuracy required for a trending models feature.

Additional context

More granular download statistics would not only benefit the implementation of trending models, but also provide useful insights for model creators and users in the Hugging Face community. It would help them to understand the adoption and usage of models more accurately and on a more frequent basis.

Thank you for considering this feature request.

yachty66 avatar Jun 20 '23 15:06 yachty66

there have been internal discussions to expose the last 7-days-downloads in addition to the last-30-days downloads

Would that work for your use case?

Beyond that we don't have current plans to expose more granular daily data. Not excluding it for the future, but not on our current roadmap

julien-c avatar Jun 20 '23 15:06 julien-c

Thank you for your prompt response and for considering this request.

Exposing the last 7 days of download data would definitely be a step in the right direction and could be useful for the trending models feature. However, having more granular daily data would still be the ideal scenario for capturing real-time trends.

In the meantime, I'll move forward with the data available and look forward to any future enhancements you may make to data granularity. Thank you again for your engagement on this issue.

yachty66 avatar Jun 20 '23 15:06 yachty66

you're welcome, please share whatever you build here (if it's public) i would love to take a look!

julien-c avatar Jun 20 '23 18:06 julien-c

+1 and to also add the version of the docker image/huggingface-community-inference api is also running

StephenHodgson avatar Jun 20 '23 23:06 StephenHodgson

Great! My personal use case for this involves automating Twitter posts about the most trending Hugging Face model of the day. I describe my approach in this tweet. Feel free to take a look at it. The repository for tracking the most trending Hugging Face models can be found here. While it is currently missing a practical implementation, the readme provides a detailed description.

yachty66 avatar Jun 21 '23 10:06 yachty66

I saw the new 'Trending on 🤗 This Week.' section. It's great!

yachty66 avatar Aug 05 '23 11:08 yachty66

I also have a question about model statistics. Is there any api that can retrieve the 'downloadsAllTime' of a model? Thanks for any information.

streamsunshine avatar Aug 22 '23 05:08 streamsunshine

@streamsunshine https://huggingface.co/api/models/bigscience/bloom?expand[]=downloadsAllTime

julien-c avatar Aug 22 '23 12:08 julien-c

Hi, how can we get monthly model statistics such as the number of downloads for each month of a model?

wwwyn avatar Oct 01 '23 21:10 wwwyn

@julien-c Hello, coming back on that, is there a way to get a historical time series of monthly (or any other frequency) number of downloads of a model, apart from the "downloadsAllTime" aggegated sum? Thank you

Kosd-1 avatar Jun 08 '24 14:06 Kosd-1