This commit is contained in:
Nick Walton
2019-09-27 14:13:50 -06:00
parent 0027ad5ab3
commit 319e894e87
+2 -2
View File
@@ -20,7 +20,7 @@ def loss(labels, logits):
class CTRLGenerator():
def __init__(self, control_code="Horror Text: ", generate_num=64, temperature=0.5, topk=40):
def __init__(self, control_code="Writing Text: ", generate_num=64, temperature=0.5, topk=40):
self.generate_num=generate_num
model_dir = "generator/ctrl/model/seqlen256_v1.ckpt/"
@@ -218,7 +218,7 @@ class CTRLGenerator():
# disallow some tokens
forbidden_tokens = ['<unk>', 'Sco@@', "&amp@@", "1]@@", "2]@@", "3]@@", "4]@@", "https://www.@@", "[@@", ":@@",
"Edit", "&@@", "2:","1:", ":", "Edit@@", "EDI@@", "EDIT@@", "edit", "TL@@", "tl@@", ";@@",
'**', "http://@@", "Redd@@", "UP@@", "mom", "Up@@", "Me:", "Update"]
'**', "http://@@", "Redd@@", "UP@@", "mom", "Up@@", "Me:", "Update", "mom@@"]
if num_new_lines > self.max_new_lines:
forbidden_tokens.append("\n")