Download src/datasets/Dataset.py from smallan13/DebateCoder: direct link, hf CLI and curl.
- Browser
- Download file 611 Bytes
-
https://huggingface.co/smallan13/DebateCoder/resolve/c7a0d4bb35b29abc02cb9891bd19979bf3eab7ad/src/datasets/Dataset.py
- Command line
-
hf download hf://smallan13/DebateCoder@c7a0d4bb35b29abc02cb9891bd19979bf3eab7ad/src/datasets/Dataset.py
-
curl -L -o Dataset.py https://huggingface.co/smallan13/DebateCoder/resolve/c7a0d4bb35b29abc02cb9891bd19979bf3eab7ad/src/datasets/Dataset.py
611 Bytes
| 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 | |
| def get_prompt(item): | |
| raise NotImplementedError | |