-
Notifications
You must be signed in to change notification settings - Fork 632
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix list_models bool parameters #1152
Conversation
The documentation is not available anymore as the PR was closed or merged. |
@_deprecate_arguments( | ||
version="0.14", | ||
deprecated_args={"cardData"}, | ||
custom_message="Use 'full' instead.", | ||
) |
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.
cardData
and full
had exactly the same behavior so I squeezed cardData
.
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.
Indeed, I tried it as well and it returns the same values. I'm not sure if this is intended though.
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.
In the codebase it was literally:
if full is not None:
if full:
params.update({"full": True})
if cardData is not None:
if cardData:
params.update({"full": True})
And I tested in on the API, "cardData" doesn't seem to be a valid parameter for the /datasets
endpoint. That's why I just removed the cardData
param. I tend to think that it comes from a copy-paste of the arguments from list_models
and not adapted correctly.
https://huggingface.co/api/datasets?limit=1 => base
https://huggingface.co/api/datasets?limit=1&cardData=1 => base
https://huggingface.co/api/datasets?limit=1&full=1 => full
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.
ah lol indeed!
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.
Apart from that, are you ok with the changes in the PR @LysandreJik ? 🙂
Codecov ReportBase: 84.59% // Head: 84.57% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1152 +/- ##
==========================================
- Coverage 84.59% 84.57% -0.02%
==========================================
Files 42 42
Lines 4187 4182 -5
==========================================
- Hits 3542 3537 -5
Misses 645 645
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
LGTM!
@_deprecate_arguments( | ||
version="0.14", | ||
deprecated_args={"cardData"}, | ||
custom_message="Use 'full' instead.", | ||
) |
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.
ah lol indeed!
Thanks for the review and approval @LysandreJik, I'm merging :) |
Fix #1146.
With this PR, params
fetch_config
andcardData
are not sent when value isFalse
inlist_models
list_datasets
. Also switched their type fromOptional[bool] = None
tobool = False
for simplicity.