Commit 13a2f1dc authored by KyuSeok Jung's avatar KyuSeok Jung Committed by GitHub

adding tag drop out option

parent 6f8a807f
......@@ -98,12 +98,12 @@ 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.opt.tag_drop_out != 0:
tags = [t for t in tags if random.random() > shared.opt.tag_drop_out]
if shared.opts.shuffle_tags:
tags = filename_text.split(',')
random.shuffle(tags)
text = text.replace("[filewords]", ','.join(tags))
else:
text = text.replace("[filewords]", filename_text)
text = text.replace("[filewords]", ','.join(tags))
return text
def __len__(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment