MCPcopy Create free account
hub / github.com/NVlabs/DiffusionNFT / TextPromptDataset

Class TextPromptDataset

scripts/evaluation.py:58–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56
57
58class TextPromptDataset(Dataset):
59 def __init__(self, dataset_path, split="test"):
60 self.file_path = os.path.join(dataset_path, f"{split}.txt")
61 if not os.path.exists(self.file_path):
62 raise FileNotFoundError(f"Dataset file not found at {self.file_path}")
63 with open(self.file_path, "r") as f:
64 self.prompts = [line.strip() for line in f.readlines()]
65
66 def __len__(self):
67 return len(self.prompts)
68
69 def __getitem__(self, idx):
70 return {"prompt": self.prompts[idx], "metadata": {}, "original_index": idx}
71
72
73class GenevalPromptDataset(Dataset):

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected