Skip to content

Commit 9a1aff6

Browse files
committed
resolve [name] after resolving [filewords] in training
1 parent 98947d1 commit 9a1aff6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/textual_inversion/dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ def shuffle(self):
9797

9898
def create_text(self, filename_text):
9999
text = random.choice(self.lines)
100-
text = text.replace("[name]", self.placeholder_token)
101100
tags = filename_text.split(',')
102101
if shared.opts.tag_drop_out != 0:
103102
tags = [t for t in tags if random.random() > shared.opts.tag_drop_out]
104103
if shared.opts.shuffle_tags:
105104
random.shuffle(tags)
106105
text = text.replace("[filewords]", ','.join(tags))
106+
text = text.replace("[name]", self.placeholder_token)
107107
return text
108108

109109
def __len__(self):

0 commit comments

Comments
 (0)