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

fix caching #336

Merged
merged 5 commits into from
Nov 8, 2022
Merged

fix caching #336

merged 5 commits into from
Nov 8, 2022

Conversation

lvwerra
Copy link
Member

@lvwerra lvwerra commented Nov 1, 2022

The current caching from the hub is not working properly. The reason is that a canonical metric is internally converted to hub namespace including the organization and the caching replaces / with -- in the cache directory name. Thus the following caching occurs:

accuracy --> evaluate-metrics/accuracy --> evaluate-metrics--accuracy

However, when trying to load the cache only accuracy is searched which is why the caching always fails. Similarly for community metrics. This PR fixes that issue by fixing the lookup paths.

Fixes #294

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Nov 1, 2022

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

Copy link
Member

@lhoestq lhoestq left a comment

Choose a reason for hiding this comment

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

Good catch ! You probably want to add a test for this though, and add some comments to explain the cache structure

src/evaluate/loading.py Outdated Show resolved Hide resolved
@lvwerra
Copy link
Member Author

lvwerra commented Nov 7, 2022

Added some comments and a few tests.

@lvwerra lvwerra requested a review from lhoestq November 7, 2022 15:30
Copy link
Member

@lhoestq lhoestq left a comment

Choose a reason for hiding this comment

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

Nice ! LGTM :)

@lvwerra lvwerra merged commit e3cf0e8 into main Nov 8, 2022
@lvwerra lvwerra deleted the fix-hub-caching branch November 8, 2022 11:20
NimaBoscarino pushed a commit to NimaBoscarino/evaluate that referenced this pull request Nov 9, 2022
* fix caching

* fix style

* fix exception

* add comments

* add tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot load metric from cache
3 participants