Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def continue_text (text: str) -> str:
- request_data = {
- 'prompt': text,
- 'length': 50
- }
- response = requests.post ("https://pelevin.gpt.dobro.ai/generate/", timeout = 10, json = request_data)
- if response.status_code != requests.codes.ok:
- raise RuntimeError (f"Request failed: {http.client.responses[response.status_code]} ({response.status_code})")
- response_data = json.loads (response.text)
- return text + response_data['replies'][0]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement