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

Dataset metadata lost when loading evaluations with ModelCard.load() #1208

Closed
lewtun opened this issue Nov 20, 2022 · 1 comment
Closed

Dataset metadata lost when loading evaluations with ModelCard.load() #1208

lewtun opened this issue Nov 20, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@lewtun
Copy link
Member

lewtun commented Nov 20, 2022

Describe the bug

When loading evaluation metadata with the ModelCard API, it seems some important information like dataset_config and dataset_split is lost.

For example, this model card has evaluations where both the dataset config and split are specified.

However, when loading the metadata with ModelCard.load(), these fields are absent since the metadata appears to be grouped under a single (task, dataset) and this optional information isn't collected. See below for a reproducible example.

Reproduction

Here's one way to see the problem:

from huggingface_hub import ModelCard

card = ModelCard.load("philschmid/bart-large-cnn-samsum")
# Expect to see dataset config/test fields here
card.data

Alternatively, we can run a check on the evaluation data itself:

from huggingface_hub import ModelCard

card = ModelCard.load("philschmid/bart-large-cnn-samsum")
metadata = card.data.to_dict()
eval_results = model_index_to_eval_results(metadata["model-index"])[1]
assert any(eval_result.dataset_config is not None for eval_result in eval_results) is True, "at least one config should exist"

Logs

No response

System info

- huggingface_hub version: 0.11.0
- Platform: Linux-4.19.0-22-cloud-amd64-x86_64-with-glibc2.10
- Python version: 3.8.13
- Running in iPython ?: Yes
- iPython shell: ZMQInteractiveShell
- Running in notebook ?: Yes
- Running in Google Colab ?: No
- Token path ?: /home/lewis_huggingface_co/.huggingface/token
- Has saved token ?: True
- Who am I ?: lewtun
- Configured git credential helpers: store
- FastAI: N/A
- Tensorflow: N/A
- Torch: 1.11.0
- Jinja2: 3.1.2
- Graphviz: N/A
- Pydot: N/A
@lewtun lewtun added the bug Something isn't working label Nov 20, 2022
lewtun added a commit that referenced this issue Nov 27, 2022
@Wauplin
Copy link
Contributor

Wauplin commented Dec 6, 2022

Fixed in #1214 by @lewtun !

@Wauplin Wauplin closed this as completed Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants