huggingface / huggingface/lighteval

[BUG] Task : `wikitext:103:document_level` does not work

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

Description

## Describe the bug
The task `wikitext:103:document_level` to calculate perplexity of a model to be done with wikitext does not work

## To Reproduce
```
import lighteval,json
from lighteval.logging.evaluation_tracker import EvaluationTracker
from lighteval.models.transformers.transformers_model import TransformersModelConfig
from lighteval.pipeline import ParallelismManager, Pipeline, PipelineParameters
from lighteval.utils.imports import is_package_available

if is_package_available("accelerate"):
from datetime import timedelta
from accelerate import Accelerator, InitProcessGroupKwargs
accelerator = Accelerator(kwargs_handlers=[InitProcessGroupKwargs(timeout=timedelta(seconds=3000))])
else:
accelerator = None

def main():
evaluation_tracker = EvaluationTracker(
output_dir="./results",
save_details=True,
)

pipeline_params = PipelineParameters(
launcher_type=ParallelismManager.ACCELERATE,
custom_tasks_directory=None, # Set to path if using custom tasks
# Remove the parameter below once your configuration is tested
# max_samples=10
)

model_config = TransformersModelConfig(
model_name="", #MODEL_NAME
device="cuda"
)
task = "wikitext:103:document_level"

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()

if __name__ == "__main__":
main()
```

## Expected behavior
The evaluation should happens to produce the perplexity of a model

## Version info
Name: lighteval
Version: 0.13.0

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the Pipeline(...)/pipeline.evaluate() entry point in the supplied reproduction and trace task resolution for `wikitext:103:document_level`. Run the smallest reproduction with lighteval 0.13.0; done means the task evaluates successfully and produces the model's perplexity.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.