Spaces:
Running
Running
Nicholas Finch
fix: default workers=0 (sequential) for Docker cache — ProcessPoolExecutor hangs on cpu-basic
d7013e6 Download src/interfaces/i_dataset.py from tisaconundrum/grassmann-cache: direct link, hf CLI and curl.
- Browser
- Download file 979 Bytes
-
https://huggingface.co/spaces/tisaconundrum/grassmann-cache/resolve/main/src/interfaces/i_dataset.py
- Command line
-
hf download hf://spaces/tisaconundrum/grassmann-cache/src/interfaces/i_dataset.py
-
curl -L -o i_dataset.py https://huggingface.co/spaces/tisaconundrum/grassmann-cache/resolve/main/src/interfaces/i_dataset.py
979 Bytes
| from abc import ABC, abstractmethod | |
| from typing import Self | |
| from torch.utils.data import DataLoader | |
| class IDataset(ABC): | |
| """Interface for dataset loading and preprocessing.""" | |
| def load(self, path: str) -> Self: | |
| """Load dataset from path.""" | |
| ... | |
| def clean(self) -> Self: | |
| """Clean and filter the dataset.""" | |
| ... | |
| def preprocess(self) -> Self: | |
| """Preprocess dataset (extract features, tokenize labels).""" | |
| ... | |
| def split(self, train_ratio: float = 0.8, val_ratio: float = 0.1) -> Self: | |
| """Split into train/val/test sets.""" | |
| ... | |
| def get_train_loader(self, batch_size: int) -> DataLoader: | |
| ... | |
| def get_val_loader(self, batch_size: int) -> DataLoader: | |
| ... | |
| def get_test_loader(self, batch_size: int) -> DataLoader: | |
| ... | |