File size: 611 Bytes
01f199c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | from utils.jsonl import read_jsonl
class Dataset(object):
def __init__(
self,
path: str,
):
self.path = path
self.data = None
self.id_key = ""
self.load()
def load(self):
self.data = read_jsonl(self.path)
def __len__(self):
return len(self.data)
def __getitem__(self, idx):
return self.data[idx]
def evaluate(
self,
item: dict,
cur_imp: str,
language: str,
):
raise NotImplementedError
@staticmethod
def get_prompt(item):
raise NotImplementedError
|