Unable to query downloads_all_time for a given model

I tried querying downloads_all_time for some models using HF API Model Info

But the downloads_all_time returns None

api = HfApi()

repo_id = "ai4bharat/IndicNER"

modelInfo = api.model_info(repo_id=repo_id)

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.

cc @Wauplin

The downloadAllTime attribute is not returned by default by the API. If you want to retrieve it, you must ask the server to do so using the expand parameter. 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
899419

snapshot_download on the other hand is a method to download files from a repo so not related to this topic.

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.:sweat_smile:

No worries and thanks for helping :slight_smile: downloads has always been there and is the “30 days downloads” but we’ve released a “downloads_all_time” sine a few months now :slight_smile: