Unable to query downloads_all_time for a given model
I tried querying downloads_all_time for some models usingHF API Model InfoBut the downloads_all_time returns Noneapi = HfApi()

repo_id = "ai4bharat/IndicNER"

modelInfo = api.model_info(repo_id=repo_id)
2024-09-09T03:42:16Z
It looks like you were able to do that the other day, but maybe the version of huggingface_hub is out of date or buggy.Also, that URL is Spaces, not models. That could also be the cause.If you can’t get it to work, you’ll have to try snapshot_download from the huggingface_hub library.github.com/huggingface/huggingface_hubSupport getting downloads from all timeopened12:55PM - 11 Jun 24 UTCclosed12:01PM - 17 Jul 24 UTCosansevieroenhancementThis can be done by using the `/models` endpoint and adding `?expand:downloadsAl…lTime`. As it's a frequent request, it might be useful to support this directly in the library. Right now, I can do it with internal utils

```
from huggingface_hub.utils._pagination import paginate
api_path = "https://huggingface.co/api/models"
models = list(paginate(api_path, params={"expand": "downloadsAllTime"}, headers={}))
```
2024-09-09T08:14:22Z
cc@Wauplin
2024-09-09T13:03:41Z
ThedownloadAllTimeattribute is not returned by default by the API. If you want to retrieve it, you must ask the server to do so using theexpandparameter. Here is an example how to use it:>>> from huggingface_hub import model_info
>>> model = model_info("black-forest-labs/FLUX.1-dev", expand=["downloadsAllTime"])
>>> model.downloads_all_time
899419snapshot_downloadon the other hand is a method to download files from a repo so not related to this topic.
2024-09-09T13:37:25Z
Sorry. Oh, you meant the attribute of the total number of downloads. Come to think of it, there used to be only a monthly download count.I had mistaken it for some kind of download utility thing.
2024-09-09T14:50:34Z
No worries and thanks for helpingdownloadshas always been there and is the “30 days downloads” but we’ve released a “downloads_all_time” sine a few months now