File size: 484 Bytes
256a159 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
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}
@ICL_EVALUATORS.register_module()
class AverageMinKEvaluator(BaseEvaluator):
def score(self, mink):
average_mink = sum(mink) / len(mink)
return {'average_mink': average_mink}
|