in torchrecipes/text/doc_classification/train_app.py [0:0]
def get_data_module(self) -> Optional[LightningDataModule]:
# check whether this is the OSS or internal DataLoader
# note that the internal dataloader expects a transform `nn.Module`
# object whereas the OSS DataLoader expects a transform config
if (
get_class_name_str(DocClassificationDataModule)
in self.datamodule_conf._target_
):
datamodule = hydra.utils.instantiate(
self.datamodule_conf, transform=self.transform_conf, _recursive_=False
)
else:
transform = hydra.utils.instantiate(self.transform_conf, _recursive_=False)
datamodule = hydra.utils.instantiate(
self.datamodule_conf, transform=transform, _recursive_=False
)
return datamodule