markov/generate.py

23 lines
No EOL
527 B
Python
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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={
'visibility': 'home',
'text': text,
}, headers={"Authorization": f"Bearer {secrets__.TOKEN}"})