aboutsummaryrefslogtreecommitdiffstats
path: root/modules/textual_inversion/dataset.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-05-14 08:46:27 +0000
committerGitHub <noreply@github.com>2023-05-14 08:46:27 +0000
commit80adb6979d46bbb832254004cac4f4f9bec9efb3 (patch)
treee206ee60f9be21e9e20d483213b7d0a610d2bdbd /modules/textual_inversion/dataset.py
parent1dcd6723242c3d691610f9ed937951baea49c2d1 (diff)
parent3ddc76342298ad0b2d14cb571ceb48c0b0c4176d (diff)
downloadstable-diffusion-webui-gfx803-80adb6979d46bbb832254004cac4f4f9bec9efb3.tar.gz
stable-diffusion-webui-gfx803-80adb6979d46bbb832254004cac4f4f9bec9efb3.tar.bz2
stable-diffusion-webui-gfx803-80adb6979d46bbb832254004cac4f4f9bec9efb3.zip
Merge branch 'dev' into find_vae
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)