(self, dataset_path, split="test")
| 72 | |
| 73 | class GenevalPromptDataset(Dataset): |
| 74 | def __init__(self, dataset_path, split="test"): |
| 75 | self.file_path = os.path.join(dataset_path, f"{split}_metadata.jsonl") |
| 76 | if not os.path.exists(self.file_path): |
| 77 | raise FileNotFoundError(f"Dataset file not found at {self.file_path}") |
| 78 | with open(self.file_path, "r", encoding="utf-8") as f: |
| 79 | self.metadatas = [json.loads(line) for line in f] |
| 80 | self.prompts = [item["prompt"] for item in self.metadatas] |
| 81 | |
| 82 | def __len__(self): |
| 83 | return len(self.prompts) |
nothing calls this directly
no outgoing calls
no test coverage detected