This commit is contained in:
nickwalton
2019-10-30 18:09:46 -06:00
parent c1601f60b1
commit cdd9a24fa7
+2 -1
View File
@@ -302,7 +302,8 @@ class CTRLGenerator():
num_new_lines = 0
for token in range(len(text) - 1, total_text_len - 1):
idx = self.generate_next_token(token, tokens_generated, options, num_new_lines, token_num, first_token=first_token, forbid_newline=False)
if self.idx2word[idx] == '\n' and token_num > 7:
is_nothing = len(cut_trailing_sentence(result)) == 0 or len(cut_trailing_quotes(result)) == 0
if self.idx2word[idx] == '\n' and token_num > 7 and not is_nothing:
return self.result_replace(result)
elif self.idx2word[idx] == '\n':
idx = self.generate_next_token(token, tokens_generated, options, num_new_lines, token_num,