-
Notifications
You must be signed in to change notification settings - Fork 570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include cardData in list_models and list_datasets #639
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR!
Would it be possible to add a bit of docs regarding how this attribute can be leveraged, for example with the co2_eq_emissions
?
https://huggingface.co/docs/hub/searching-the-hub
I observed the same, putting cardData
to True
or False
does not change the time required to list all models, so it's fine for me to put it enabled by default.
can you compare the underlying API calls? I think you're not seeing too much bc we have good bandwidth, but the underlying calls outputs from /api/models would have very different content sizes imo. |
Co-authored-by: Lysandre Debut <lysandre@huggingface.co>
@julien-c @LysandreJik should be good now. I made the |
lgtm! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the tests, LGTM
Co-authored-by: Lysandre Debut <lysandre@huggingface.co>
Merging PR. For transparency: self.assertTrue(all([not hasattr(dataset, "cardData") for dataset in datasets])) This will always fail because it is hard coded into the @LysandreJik let me know if you'd like me to clean that up a bit with some |
To support listing the carbon emissions as well as any other metadata that can be returned with
cardData:True
, this PR now includes that as a parameter to bothlist_models
andlist_datasets
.Note: By default this is
True
because timing wise I did not see a difference between with vs withoutcardData
, and returning the metadata for each model and dataset only increases the understandability of each one IMO.cc @julien-c @LysandreJik