from opencompass.registry import ICL_EVALUATORS | |
from .icl_base_evaluator import BaseEvaluator | |
class AveragePPLEvaluator(BaseEvaluator): | |
def score(self, ppl): | |
average_ppl = sum(ppl) / len(ppl) | |
return {'average_ppl': average_ppl} | |
class AverageMinKEvaluator(BaseEvaluator): | |
def score(self, mink): | |
average_mink = sum(mink) / len(mink) | |
return {'average_mink': average_mink} | |