mirror of
https://github.com/open-compass/opencompass.git
synced 2025-05-30 16:03:24 +08:00
12 lines
286 B
Python
12 lines
286 B
Python
from opencompass.registry import ICL_EVALUATORS
|
|
|
|
from .icl_base_evaluator import BaseEvaluator
|
|
|
|
|
|
@ICL_EVALUATORS.register_module()
|
|
class AveragePPLEvaluator(BaseEvaluator):
|
|
|
|
def score(self, ppl):
|
|
average_ppl = sum(ppl) / len(ppl)
|
|
return {'average_ppl': average_ppl}
|