This commit is contained in:
Nick
2019-10-29 10:02:52 -06:00
parent 05a6c509fb
commit 25614b0b86
+2 -2
View File
@@ -20,7 +20,7 @@ def loss(labels, logits):
class CTRLGenerator():
def __init__(self, control_code="Writing Text: ", generate_num=45, temperature=0.5, topk=40, nucleus_prob=0):
def __init__(self, control_code="Writing Text: ", generate_num=45, temperature=0.25, topk=50, nucleus_prob=0):
self.generate_num=generate_num
model_dir = "generator/ctrl/training_utils/seqlen256_v1.ckpt/"
@@ -219,7 +219,7 @@ class CTRLGenerator():
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", "mom@@", "Part",
"http://www.@@", "edit@@", "*@@", "\n", "Writing", "Text@@"]
"http://www.@@", "edit@@", "*@@", "\n", "Writing", "Text@@", "[[@@]", "\\@@", "<br>@@", "<div", "|@@"]
if num_new_lines > self.max_new_lines:
forbidden_tokens.append("\n")