-
Notifications
You must be signed in to change notification settings - Fork 269
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
add list_evaluation_modules
function
#59
Conversation
list_evaluation_modules
function
The documentation is not available anymore as the PR was closed or merged. |
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.
Looks very good! 🔥 thanks for the PR!
I left some questions/suggestions
src/evaluate/inspect.py
Outdated
with_details (:obj:`bool`, optional, default ``False``): Return the full details on the metrics instead of only the short name. | ||
type (:obj:`string`, optional, default ``None``): Type of evaluation modules to list. If ``None`` all types are listed. | ||
include_community (:obj:`bool`, optional, default ``True``): Include community modules in the list. | ||
with_details (:obj:`bool`, optional, default ``False``): Return the full details on the metrics instead of only the ID. |
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.
Maybe for consistency with huggingface_hub
this should be renamed to full
. No strong thoughts though.
src/evaluate/inspect.py
Outdated
@@ -31,41 +32,67 @@ class SplitsNotFoundError(ValueError): | |||
pass | |||
|
|||
|
|||
def list_metrics(with_community_metrics=True, with_details=False): | |||
def list_evaluation_modules(type=None, include_community=True, with_details=False): | |||
"""List all the metrics script available on the Hugging Face Hub. |
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.
Maybe you should clarify that this return a list of repo ids. The name tells me it returns a list of modules, which is a bit confusing since it really returns ids. Similar with the docstring
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.
I actually changed this a bit: for canonical modules the the namespace is omitted so this function returns what the user should put into load()
function. Technically, load("evaluate-metric/accuracy")
also works but I think we should use load("accuracy")
as the standard.
|
||
r = requests.get(HF_LIST_ENDPOINT.format(type=type)) | ||
r.raise_for_status() | ||
d = r.json() |
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.
At one point it would be cool to have list_spaces
in huggingface_hub
. I opened huggingface/huggingface_hub#881
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.
Looks great!! Thank you 🚀
Co-authored-by: Omar Sanseviero <osanseviero@gmail.com>
Updates the
list_metrics
function tolist_evaluation_modules
. It uses thehttps://huggingface.co/api/spaces?filter={type}
endpoint to query all available modules from the hub.cc @julien-c