Last active
December 10, 2021 01:47
-
-
Save stas00/a98c4f0846e1b75541b9bbba28f3b185 to your computer and use it in GitHub Desktop.
most popular HF model downloads by architecture (thanks to @LysandreJik)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from transformers import CONFIG_MAPPING | |
from huggingface_hub import HfApi | |
api = HfApi() | |
keys = list(CONFIG_MAPPING.keys()) | |
downloads = {} | |
for key in keys: | |
models = api.list_models(filter=key) | |
total_downloads = sum(model.downloads if hasattr(model, "downloads") else 0 for model in models) | |
downloads[key] = total_downloads | |
ordered = sorted(downloads.items(), reverse=True, key=lambda t: t[1]) | |
for key, value in ordered: | |
print(f"Architecture {key} has {value} total downloads") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment