CoolFace
Apppublic

drizzymedia/StreamDiffusionV2-Realtime

sourceHugging Faceupdated 2mo agoView on Hugging Face
1likes
data.py18 linesDownload Raw Back to models
1"""Minimal dataset helpers used by inference entrypoints."""2 3from torch.utils.data import Dataset4 5 6class TextDataset(Dataset):7    """Load one prompt per line from a UTF-8 text file."""8 9    def __init__(self, data_path: str):10        with open(data_path, "r", encoding="utf-8") as handle:11            self.texts = [line.strip() for line in handle]12 13    def __len__(self) -> int:14        return len(self.texts)15 16    def __getitem__(self, idx: int) -> str:17        return self.texts[idx]18