aboutsummaryrefslogtreecommitdiffstats
path: root/modules/textual_inversion/dataset.py
diff options
context:
space:
mode:
authorpapuSpartan <30642826+papuSpartan@users.noreply.github.com>2023-05-12 03:40:17 +0000
committerpapuSpartan <30642826+papuSpartan@users.noreply.github.com>2023-05-12 03:40:17 +0000
commit75b3692920e8dceb9031dd405b9226b55d286ce1 (patch)
treeb7bb9db2aca00e54525b82ed1d902eac273766b9 /modules/textual_inversion/dataset.py
parentf0efc8c211fc2d2c2f8caf6e2f92501922d18c99 (diff)
parentabe32cefa39dee36d7f661d4e63c28ea8dd60c4f (diff)
downloadstable-diffusion-webui-gfx803-75b3692920e8dceb9031dd405b9226b55d286ce1.tar.gz
stable-diffusion-webui-gfx803-75b3692920e8dceb9031dd405b9226b55d286ce1.tar.bz2
stable-diffusion-webui-gfx803-75b3692920e8dceb9031dd405b9226b55d286ce1.zip
Merge branch 'dev' of https://github.com/AUTOMATIC1111/stable-diffusion-webui into tomesd
Diffstat (limited to 'modules/textual_inversion/dataset.py')
-rw-r--r--modules/textual_inversion/dataset.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/textual_inversion/dataset.py b/modules/textual_inversion/dataset.py
index af9fbcf2..b9621fc9 100644
--- a/modules/textual_inversion/dataset.py
+++ b/modules/textual_inversion/dataset.py
@@ -72,7 +72,7 @@ class PersonalizedBase(Dataset):
except Exception:
continue
- text_filename = os.path.splitext(path)[0] + ".txt"
+ text_filename = f"{os.path.splitext(path)[0]}.txt"
filename = os.path.basename(path)
if os.path.exists(text_filename):
@@ -118,7 +118,7 @@ class PersonalizedBase(Dataset):
weight = torch.ones(latent_sample.shape)
else:
weight = None
-
+
if latent_sampling_method == "random":
entry = DatasetEntry(filename=path, filename_text=filename_text, latent_dist=latent_dist, weight=weight)
else:
@@ -243,4 +243,4 @@ class BatchLoaderRandom(BatchLoader):
return self
def collate_wrapper_random(batch):
- return BatchLoaderRandom(batch) \ No newline at end of file
+ return BatchLoaderRandom(batch)