diff options
author | parasi <kingofint22@gmail.com> | 2022-11-13 19:44:27 +0000 |
---|---|---|
committer | parasi <kingofint22@gmail.com> | 2022-11-13 19:49:28 +0000 |
commit | 9a1aff645a4bea745145c57c96950fbd3fcca27c (patch) | |
tree | 432ed9ad1b1287f3e016bc88e5260bcbbf6516fa /modules/textual_inversion | |
parent | 98947d173e3f1667eba29c904f681047dea9de90 (diff) | |
download | stable-diffusion-webui-gfx803-9a1aff645a4bea745145c57c96950fbd3fcca27c.tar.gz stable-diffusion-webui-gfx803-9a1aff645a4bea745145c57c96950fbd3fcca27c.tar.bz2 stable-diffusion-webui-gfx803-9a1aff645a4bea745145c57c96950fbd3fcca27c.zip |
resolve [name] after resolving [filewords] in training
Diffstat (limited to 'modules/textual_inversion')
-rw-r--r-- | modules/textual_inversion/dataset.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/textual_inversion/dataset.py b/modules/textual_inversion/dataset.py index eb75c376..06f271f9 100644 --- a/modules/textual_inversion/dataset.py +++ b/modules/textual_inversion/dataset.py @@ -97,13 +97,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 shared.opts.tag_drop_out != 0:
tags = [t for t in tags if random.random() > shared.opts.tag_drop_out]
if shared.opts.shuffle_tags:
random.shuffle(tags)
text = text.replace("[filewords]", ','.join(tags))
+ text = text.replace("[name]", self.placeholder_token)
return text
def __len__(self):
|