aboutsummaryrefslogtreecommitdiffstats
path: root/modules/textual_inversion/dataset.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2022-11-27 19:46:49 +0000
committerGitHub <noreply@github.com>2022-11-27 19:46:49 +0000
commit39827a3998afa3ea612e7cc9a475085765d4d509 (patch)
treef17335b4b47fe78adfb22ce8e6ec4c8efd7f2ce0 /modules/textual_inversion/dataset.py
parent9e78d2c419732711e984c4478af15ece121d64fd (diff)
parent9a1aff645a4bea745145c57c96950fbd3fcca27c (diff)
downloadstable-diffusion-webui-gfx803-39827a3998afa3ea612e7cc9a475085765d4d509.tar.gz
stable-diffusion-webui-gfx803-39827a3998afa3ea612e7cc9a475085765d4d509.tar.bz2
stable-diffusion-webui-gfx803-39827a3998afa3ea612e7cc9a475085765d4d509.zip
Merge pull request #4688 from parasi22/resolve-embedding-name-in-filewords
resolve [name] after resolving [filewords] in training
Diffstat (limited to 'modules/textual_inversion/dataset.py')
-rw-r--r--modules/textual_inversion/dataset.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/textual_inversion/dataset.py b/modules/textual_inversion/dataset.py
index f470324a..e5725f33 100644
--- a/modules/textual_inversion/dataset.py
+++ b/modules/textual_inversion/dataset.py
@@ -117,13 +117,13 @@ class PersonalizedBase(Dataset):
def create_text(self, filename_text):
text = random.choice(self.lines)
- text = text.replace("[name]", self.placeholder_token)
tags = filename_text.split(',')
if self.tag_drop_out != 0:
tags = [t for t in tags if random.random() > self.tag_drop_out]
if self.shuffle_tags:
random.shuffle(tags)
text = text.replace("[filewords]", ','.join(tags))
+ text = text.replace("[name]", self.placeholder_token)
return text
def __len__(self):