This commit is contained in:
root
2019-11-16 04:06:50 +00:00
parent eb8cc5e9bb
commit 9934ab4251
+3 -1
View File
@@ -78,7 +78,9 @@ def cut_trailing_sentence(text):
text = standardize_punctuation(text)
last_punc = max(text.rfind('.'), text.rfind("!"), text.rfind("?"))
last_punc = min(text.rfind("<|endoftext|>"), last_punc)
et_token = text.rfind("<|endoftext|>")
if et_token != -1:
last_punc = min(last_punc, et_token)
if last_punc > 0:
text = text[0:last_punc+1]