From 33ea8fe83053f39bac70623d656fe8d0fee68dc3 Mon Sep 17 00:00:00 2001 From: Lynne Date: Mon, 29 Oct 2018 11:23:01 +1000 Subject: [PATCH] fixed another possibility for the bots to get stuck --- create.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/create.py b/create.py index 152a5cd..24c3af9 100755 --- a/create.py +++ b/create.py @@ -29,8 +29,10 @@ def make_sentence(output): os.remove("toots-copy.db") sentence = None - while sentence is None: + tries = 0 + while sentence is None and tries < 10: sentence = model.make_short_sentence(500, tries=10000) + tries = tries + 1 sentence = re.sub("^@\u202B[^ ]* ", "", sentence) output.send(sentence)