huggingface / huggingface/lighteval

Fix KeyError in truthful_qa_generative_prompt

Open
#1,130 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
2.5k
Forks
555
Avg merge
1d 6h
Merged PRs (30d)
1

Description

## Describe the bug
The `truthful_qa_generative_prompt` function failed with a `KeyError: 'mc1_targets'` because it attempted to access a column that does not exist in the generative subset of the dataset.

## To Reproduce
```python
task = "truthfulqa:gen|5"

pipeline = Pipeline(
tasks=task,
pipeline_parameters=pipeline_params,
evaluation_tracker=evaluation_tracker,
model_config=model_config,
)

pipeline.evaluate()
pipeline.save_and_push_results()
pipeline.show_results()
```

## Expected behavior
The function should not attempt to access `mc1_targets` for the generative subset.

## Version info
- OS: mac
- Lighteval version: main (local development)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.