From c5df3ebfd24853a70bf02f5abda15dc81d1cb973 Mon Sep 17 00:00:00 2001 From: "clementine@huggingface.co" Date: Fri, 26 Jan 2024 17:57:26 +0000 Subject: [PATCH] add none back --- src/lighteval/metrics/metrics_corpus.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lighteval/metrics/metrics_corpus.py b/src/lighteval/metrics/metrics_corpus.py index 63dc2a56b..5cdfa6d13 100644 --- a/src/lighteval/metrics/metrics_corpus.py +++ b/src/lighteval/metrics/metrics_corpus.py @@ -39,9 +39,9 @@ def __init__(self, average: str, num_classes: int = 2): average (str): Method to use to compute the f1 score. Can be weighted, macro, micro. num_classes (int, optional): Num of possible choice classes. Defaults to 2. If this parameter is above 2, we'll compute multi f1 corpus score """ - if average not in ["weighted", "macro", "micro"]: + if average not in ["weighted", "macro", "micro", None]: raise ValueError( - f"A CorpusLevelF1Score must be initialized with weighted, macro, micro as an average function. {average} was used." + f"A CorpusLevelF1Score must be initialized with weighted, macro, micro, or None as an average function. {average} was used." ) self.average = average self.num_classes = num_classes