Skip to content
Discussion options

You must be logged in to vote

Dear @brijow,

I wondered if something like that could fit your use-case ?

class MyDataModule(LightningDataModule):

    def __init__(self):

        self._processed_train_dataset = None

    def setup(self):
        self.train_dataset = ...

    @property
    def processed_train_dataset(self):
        return self._processed_train_dataset or self.train_dataset

    @processed_train_dataset.setter
    def processed_train_dataset(self, processed_train_dataset):
        self._processed_train_dataset = processed_train_dataset
    
    def train_dataloader(self):
        return DataLoader(self.processed_train_dataset)


class Preprocessing1(Callback):

    def preprocess_function(self, dataset)…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@brijow
Comment options

@tchaton
Comment options

Answer selected by brijow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment