fixed another possibility for the bots to get stuck
This commit is contained in:
parent
f39fbc9c67
commit
33ea8fe830
1 changed files with 3 additions and 1 deletions
|
@ -29,8 +29,10 @@ def make_sentence(output):
|
||||||
os.remove("toots-copy.db")
|
os.remove("toots-copy.db")
|
||||||
|
|
||||||
sentence = None
|
sentence = None
|
||||||
while sentence is None:
|
tries = 0
|
||||||
|
while sentence is None and tries < 10:
|
||||||
sentence = model.make_short_sentence(500, tries=10000)
|
sentence = model.make_short_sentence(500, tries=10000)
|
||||||
|
tries = tries + 1
|
||||||
sentence = re.sub("^@\u202B[^ ]* ", "", sentence)
|
sentence = re.sub("^@\u202B[^ ]* ", "", sentence)
|
||||||
output.send(sentence)
|
output.send(sentence)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue