Spaces:
Running
Running
File size: 598 Bytes
2c50826 5cac937 199a7d9 2c50826 199a7d9 2c50826 199a7d9 2c50826 |
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 |
from pathlib import Path
from typing import Iterator, List, Tuple
from datasets import load_dataset
class DrawBenchPrompts:
def __init__(self):
self.dataset = load_dataset("shunk031/DrawBench")["test"]
def __iter__(self) -> Iterator[Tuple[str, Path]]:
for i, row in enumerate(self.dataset):
yield row["prompts"], Path(f"{i}.png")
@property
def name(self) -> str:
return "draw_bench"
@property
def size(self) -> int:
return len(self.dataset)
@property
def metrics(self) -> List[str]:
return ["image_reward"]
|