From f23fd5184b8ba4ec04506495f4a61726e50756f7 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Mon, 3 Oct 2022 17:38:44 +0200 Subject: Small perf improvements --- data/textual_inversion/csv.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'data/textual_inversion/csv.py') diff --git a/data/textual_inversion/csv.py b/data/textual_inversion/csv.py index 64f0c28..852b1cb 100644 --- a/data/textual_inversion/csv.py +++ b/data/textual_inversion/csv.py @@ -60,8 +60,8 @@ class CSVDataModule(pl.LightningDataModule): placeholder_token=self.placeholder_token, center_crop=self.center_crop) val_dataset = CSVDataset(self.data_val, self.tokenizer, size=self.size, interpolation=self.interpolation, placeholder_token=self.placeholder_token, center_crop=self.center_crop) - self.train_dataloader_ = DataLoader(train_dataset, batch_size=self.batch_size, shuffle=True) - self.val_dataloader_ = DataLoader(val_dataset, batch_size=self.batch_size) + self.train_dataloader_ = DataLoader(train_dataset, batch_size=self.batch_size, pin_memory=True, shuffle=True) + self.val_dataloader_ = DataLoader(val_dataset, batch_size=self.batch_size, pin_memory=True) def train_dataloader(self): return self.train_dataloader_ -- cgit v1.2.3-70-g09d2