This commit is contained in:
nickwalton
2019-10-31 19:49:13 -06:00
2 changed files with 2 additions and 3 deletions
+1
View File
@@ -34,6 +34,7 @@ def play_unconstrained():
action = input("> ")
if action != "":
action = action[0].lower() + action[1:]
if action[-1] == "." or action[-1] == "?" or action[-1] == "!":
action = action[:-1]
+1 -3
View File
@@ -276,7 +276,7 @@ class CTRLGenerator():
def generate(self, prompt, options=None):
prompt = self.prompt_replace(prompt)
debug_print = True
debug_print = False
if debug_print:
print("\n\n*****DEBUG*****")
@@ -315,8 +315,6 @@ class CTRLGenerator():
if debug_print:
print(repr(self.idx2word[idx]), end="_")
import pdb
pdb.set_trace()
tokens_generated_so_far = ' '.join([self.idx2word[c] for c in tokens_generated[0][len(text):token+2]])
tokens_generated_so_far = re.sub('(@@ )', '', string=tokens_generated_so_far)
tokens_generated_so_far = re.sub('(@@ ?$)', '', string=tokens_generated_so_far)