Skip to content
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

added autoeval fields to repocard types #901

Merged
merged 17 commits into from
Jun 21, 2022

Conversation

TristanThrush
Copy link
Contributor

@TristanThrush TristanThrush commented Jun 10, 2022

This PR makes the repocard types consistent with the spec that autoeval uses: https://raw.githubusercontent.com/huggingface/hub-docs/main/modelcard.md

It is based on lewis's PR here, but it only includes the necessary changes to repocard_types.py

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jun 10, 2022

The documentation is not available anymore as the PR was closed or merged.

@TristanThrush TristanThrush marked this pull request as draft June 10, 2022 23:47
@TristanThrush TristanThrush marked this pull request as ready for review June 13, 2022 17:49
@TristanThrush TristanThrush requested a review from lewtun June 13, 2022 17:49
Copy link
Member

@lewtun lewtun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for adding this - LGTM!

Let's wait for a review from the huggingface_hub maintainers before merging this.

cc @LysandreJik @julien-c

task: "SingleResultTask"
dataset: "Optional[SingleResultDataset]"
metrics: "List[SingleMetric]"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For reviewers: this ordering of task > dataset > metrics is more natural and easier to review during Hub PRs

Copy link
Member

@julien-c julien-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!

@adrinjalali
Copy link
Contributor

cc @nateraw

Copy link
Contributor

@nateraw nateraw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be nice to show how to use this in one of the docstrings in repocard.py, but other than that looks good to me.

- type: accuracy
value: 0.2662102282047272
name: Accuracy
verified: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - should we add config in example here too, since you added that with this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this feedback!

In order to do this, were you thinking that I should also update the inputs to metadata_eval_result function here: https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/repocard.py#L80

An additional change like this is needed, because the test here won't pass otherwise:
https://github.com/huggingface/huggingface_hub/blob/main/tests/test_repocard.py#L166

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's what you were thinking. I just pushed a change where I added optional fields to metadata_eval_result and added documentation. lmk what you think!

@lewtun
Copy link
Member

lewtun commented Jun 16, 2022

Hi @adrinjalali can you please advise us on how to handle the failing codecov test? Is it a question of writing more unit tests for the repocard or something else?

@lewtun
Copy link
Member

lewtun commented Jun 16, 2022

In order to migrate the AutoTrain backend to use #888 instead of #884, we'll actually need the changes in this PR to be available in @SBrandeis' fork/branch. (We rely on the additional metadata fields provided by the current PR)

To unblock @coyotte508 in https://github.com/huggingface/moon-landing/pull/3144 (which disables the upload_file() endpoint we use in AutoTrain) one possibility is to:

  1. Close added autoeval fields to repocard types #901 and open an identical one on @SBrandeis's branch that takes into account the reviewer feedback.
  2. Migrate the AutoTrain backend to use ✨ New create_commit API #888 once step (1) is merged

This isn't a pretty solution and it pollutes #888 with changes unrelated to the new API.

An alternative would be to:

In the interest of releasing a stable evaluation service without lots of hacks, I'm in favour of the second option as long as it doesn't delay the release by too much. @SBrandeis do you have a rough idea how long it will take to get your PR merged?

cc @douwekiela @TristanThrush @abhishekkrthakur

@lewtun
Copy link
Member

lewtun commented Jun 17, 2022

After discussing internally, we'll go for the option to wait until #888 is merged before migrating the AutoTrain backend.

@coyotte508 from my side: feel free to merge https://github.com/huggingface/moon-landing/pull/3144 when you want :)

@coyotte508
Copy link
Member

coyotte508 commented Jun 17, 2022

@lewtun https://github.com/huggingface/moon-landing/pull/3144 is ready to be merged

Nothing's going to burn on your side, right? 😅

@lewtun
Copy link
Member

lewtun commented Jun 17, 2022

Nothing's going to burn on your side, right? 😅

Nope, the eval service is still in dev but let's quickly ask @gante for confirmation since I believe he was using my branch in transformers

@gante
Copy link
Member

gante commented Jun 17, 2022

Don't mind transformers, I'm the sole user of the related functionality and I can hold it for a few days.

I will make the appropriate changes as soon as #888 gets merged 👍

@TristanThrush TristanThrush requested a review from nateraw June 17, 2022 23:06
lsb and others added 12 commits June 19, 2022 12:07
* Add errors

* Style

* Review

* hf_hub_download support

* Errors for hf_hub_download

* Typo

* Handle 401 error

* Tests for 401 error

* Typo

* Review comments
* 🏗 Use `hub-ci` for tests

cc @XciD

* 🩹 Also update URL for staging mode

* ✅ 401 is raised when the user is not authenticated

* 🗑 Deprecare `identical_ok`

* Longer deprecation period

* ✅ Fix the last failing test

* Warning match docstring
* fix for spaces

* fix for spaces

* removed creating repository and added warning

* revert my changes

* added tests

* removed debugger 😐

* fixed repository removal

* Added tests and error

* import pytest

* fixed tests

* fixed tests

* style

* removed repo removal

* make style

* fixed test with Lysandres patch

* added fix
* Remove deprecations

* Typo

* Update src/huggingface_hub/README.md

Co-authored-by: Julien Chaumond <julien@huggingface.co>

Co-authored-by: Julien Chaumond <julien@huggingface.co>
* Add request ID to all requests

* Typo

* Typo

* Review comments

* Update src/huggingface_hub/utils/_errors.py

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Invert deprecation for create_repo

* Set to 0.10
Co-authored-by: lewtun <lewis.c.tunstall@gmail.com>
@TristanThrush TristanThrush force-pushed the fix/add_autoeval_fields_to_repocard_types branch from 6674175 to 74ace9d Compare June 19, 2022 19:09
Copy link
Contributor

@adrinjalali adrinjalali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @adrinjalali can you please advise us on how to handle the failing codecov test? Is it a question of writing more unit tests for the repocard or something else?

codecov runs two tests, one to check the percentage of tests in the PR's patch, the other one on the whole project. For this PR, the only thing left to test now are metrics_config and metrics_verified.

"""
Creates a metadata dict with the result from a model evaluated on a dataset.

Example:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the example section should come after the Returns section

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, added setting of metrics_config and metrics_verified to tests and did the reordering suggestion that you mentioned for the documentation.

@adrinjalali adrinjalali merged commit 80d4a9e into main Jun 21, 2022
@adrinjalali adrinjalali deleted the fix/add_autoeval_fields_to_repocard_types branch June 21, 2022 07:27
julien-c added a commit that referenced this pull request Jun 27, 2022
* fix link

* `verified` should be omitted when false

* move docstring to its actual attribute

* Attempt to show that `args` should be a dict
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.