summaryrefslogtreecommitdiffstats
path: root/data
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2022-10-12 08:18:22 +0200
committerVolpeon <git@volpeon.ink>2022-10-12 08:18:22 +0200
commitf5b656d21c5b449eed6ce212e909043c124f79ee (patch)
tree905f20900433f1e77840cd66417395168e0eec7f /data
parentAdded EMA support to Textual Inversion (diff)
downloadtextual-inversion-diff-f5b656d21c5b449eed6ce212e909043c124f79ee.tar.gz
textual-inversion-diff-f5b656d21c5b449eed6ce212e909043c124f79ee.tar.bz2
textual-inversion-diff-f5b656d21c5b449eed6ce212e909043c124f79ee.zip
Various updates
Diffstat (limited to 'data')
-rw-r--r--data/csv.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/data/csv.py b/data/csv.py
index 8637ac1..253ce9e 100644
--- a/data/csv.py
+++ b/data/csv.py
@@ -68,13 +68,12 @@ class CSVDataModule(pl.LightningDataModule):
68 item.nprompt if "nprompt" in item else "" 68 item.nprompt if "nprompt" in item else ""
69 ) 69 )
70 for item in data 70 for item in data
71 if "skip" not in item or item.skip != "x"
72 for i in range(image_multiplier) 71 for i in range(image_multiplier)
73 ] 72 ]
74 73
75 def prepare_data(self): 74 def prepare_data(self):
76 metadata = pd.read_csv(self.data_file) 75 metadata = pd.read_csv(self.data_file)
77 metadata = list(metadata.itertuples()) 76 metadata = [item for item in metadata.itertuples() if "skip" not in item or item.skip != "x"]
78 num_images = len(metadata) 77 num_images = len(metadata)
79 78
80 valid_set_size = int(num_images * 0.2) 79 valid_set_size = int(num_images * 0.2)