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: Load metrics from centralised folder #15

Merged

Conversation

ruivieira
Copy link
Member

In order to perform evaluations in offline mode, the HF evaluate metrics must be present.
Since metrics are loaded from the current working directory, this could cause conflicts whenever a dataset had the same name as the metric (e.g. glue dataset and glue metric). LMEval would try to load the metric as the dataset.
This issue is more prevalent with unitxt, where there is no way to modify the default loading path from LMEval.
In order to avoid conflicts and still use unitxt in offline mode:

  • The metrics were moved to a central location (metrics, avoiding conflicts)
  • If using online mode, these local metrics are not used
  • If using offline mode, the evaluate load method is patched to use the local metrics (or provided folder)

It is possible to provide a custom metrics folder by supplying the LMEVAL_METRICS_PREFIX environment variable. If not specified the bundled metrics folder is used.

Description

  • Move the metrics to a centralised folder
  • Modify the evaluate metrics loader to load from supplied path (only in offline mode)

How Has This Been Tested?

Exploratory testing using scenarios in https://github.com/trustyai-explainability/reference/blob/main/lm-eval/LM-EVAL-NEXT.md

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@ruivieira ruivieira added the kind/enhancement New feature or request label Jan 8, 2025
@ruivieira ruivieira self-assigned this Jan 8, 2025
@ruivieira ruivieira mentioned this pull request Jan 8, 2025
3 tasks
lm_eval/__main__.py Outdated Show resolved Hide resolved
Copy link

@danielezonca danielezonca left a comment

Choose a reason for hiding this comment

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

lgtm

@ruivieira ruivieira merged commit bc4f819 into opendatahub-io:release-0.4.5 Jan 8, 2025
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants