mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-09-06 11:32:10 +00:00
[feature] ColossalEval: Evaluation Pipeline for LLMs (#4786)
* Add ColossalEval * Delete evaluate in Chat --------- Co-authored-by: Xu Yuanchen <yuanchen.xu00@gmail.com> Co-authored-by: Tong Li <tong.li352711588@gmail.com>
This commit is contained in:
24
applications/ColossalEval/colossal_eval/dataset/base.py
Normal file
24
applications/ColossalEval/colossal_eval/dataset/base.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from abc import abstractstaticmethod
|
||||
|
||||
from colossal_eval.utils import jdump
|
||||
|
||||
|
||||
class BaseDataset:
|
||||
"""
|
||||
Base class for dataset wrapper.
|
||||
|
||||
Args:
|
||||
path: The path to the original dataset.
|
||||
logger: Logger for the dataset.
|
||||
"""
|
||||
|
||||
def __init__(self, path, logger, few_shot):
|
||||
self.dataset = self.load(path, logger, few_shot)
|
||||
|
||||
def save(self, save_path):
|
||||
"""Save the converted dataset"""
|
||||
jdump(self.dataset, save_path)
|
||||
|
||||
@abstractstaticmethod
|
||||
def load(path, logger):
|
||||
"""Load the original dataset and convert it into the inference dataset"""
|
Reference in New Issue
Block a user