MCPcopy Create free account
hub / github.com/CodeGoat24/UniGenBench / UniGenBenchDataset

Class UniGenBenchDataset

inference/flux_en_multi_node_inference.py:21–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19from diffusers.schedulers import FlowMatchEulerDiscreteScheduler
20
21class UniGenBenchDataset(Dataset):
22 def __init__(
23 self, csv_path,
24 ):
25 self.csv_path = csv_path
26
27 df = pd.read_csv(self.csv_path)
28
29 self.dataset = df["prompt_en"].tolist()
30 self.index_list = df["index"].tolist()
31
32 def __getitem__(self, idx):
33
34 caption = self.dataset[idx]
35 index = self.index_list[idx]
36 return dict(caption=caption, idx=index)
37
38 def __len__(self):
39 return len(self.dataset)
40
41
42def main(args):

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected