Skip to content
Discussion options

You must be logged in to vote

Ok I found a way to do it. I have something like the following in the datamodule. This is functional but I'd be interested if there a better pattern I can employ here.

class MyDM(L.LightningDataModule):
    ...
    def setup(self, stage):
        self._load_tokenizer()
        if hasattr(self, "trainer"): # here I communicate the tokenizer to the model
            self.trainer.lightning_module.tokenizer= self.tokenizer

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by abefrandsen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment