huggingface / huggingface/lighteval

Fix RecursionError in imdb_contrastset_prompt

Open
#1,154 0 comments 0 reactions 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 `imdb_contrastset_prompt` function contained an incorrect call to the task config.
## To Reproduce
```python
task = "imdb:contrastset|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()
```
```
TypeError Traceback (most recent call last)
Cell In[3], line 29
18 model_config = LiteLLMModelConfig(
19 model_name="openai/gpt-4.1",
20 base_url="https://api.openai.com/v1",
(...) 24 )
25 )
27 task = "imdb:contrastset|5"
---> 29 pipeline = Pipeline(
30 tasks=task,
31 pipeline_parameters=pipeline_params,
32 evaluation_tracker=evaluation_tracker,
33 model_config=model_config,
34 )
36 pipeline.evaluate()
37 pipeline.save_and_push_results()

File ~/Code/Evalhub/backend/lighteval/src/lighteval/pipeline.py:142, in Pipeline.__init__(self, tasks, pipeline_parameters, evaluation_tracker, model_config, model, metric_options)
140 # We init tasks first to fail fast if one is badly defined
141 self._init_random_seeds()
--> 142 self._init_tasks_and_requests(tasks=tasks)
144 self.model_config = model_config
145 self.accelerator, self.parallel_context = self._init_parallelism_manager()
...
43 choices=["Positive", "Negative"],
44 gold_index=["Positive", "Negative"].index(line["contrast_references"]),
45 )

TypeError: 'LightevalTaskConfig' object is not callable
```

## Expected behavior
The function should correctly delegate to the base `imdb_prompt` and return a valid `Doc` object.

## 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.