markov/generate.py

24 lines
564 B
Python
Raw Permalink Normal View History

2024-02-23 15:05:37 +03:00
import chain
import sys
import requests
import secrets__
model_f = open("model.json")
model = chain.Text.from_json(model_f.read())
generated = False
text = None
while not generated:
text = model.make_short_sentence(80, tries=900, min_words=3)
generated = text is not None
text = text.replace('@','@').replace('#','#')
print(text)
requests.post("https://beeping.synth.download/api/iceshrimp/notes", json={
2024-02-23 15:05:37 +03:00
'visibility': 'home',
'text': text,
2025-04-23 12:11:45 -05:00
#'cw': 'gyattov generated text',
2025-04-19 12:04:38 -05:00
}, headers={"Authorization": f"Bearer {secrets__.TOKEN}"})