Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/lighteval/tasks/lighteval_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ def _get_docs_from_split(self, splits: list[str], few_shots=False) -> list[Doc]:
# Some tasks require to know which is the current item index in order to apply a different prompt template
item["__index"] = ix
doc = self.formatter(item, self.name)

# Skip if formatter returns None (e.g., to filter out certain samples)
if doc is None:
continue

doc.id = str(ix)

# Transfer task-level generation parameters to the document
Expand Down
Loading