From 8a5cef4debe9978fafe540ee4c532565c32c775a Mon Sep 17 00:00:00 2001 From: Fjerkroa Auto Date: Sat, 19 Aug 2023 21:23:41 +0200 Subject: [PATCH] Add log output, to see which drawing enginge was used. --- fjerkroa_bot/ai_responder.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fjerkroa_bot/ai_responder.py b/fjerkroa_bot/ai_responder.py index 13dcb47..6dd3a9d 100644 --- a/fjerkroa_bot/ai_responder.py +++ b/fjerkroa_bot/ai_responder.py @@ -150,6 +150,7 @@ class AIResponder(object): response = await openai.Image.acreate(prompt=description, n=1, size="512x512") async with aiohttp.ClientSession() as session: async with session.get(response['data'][0]['url']) as image: + logging.info(f'Drawed a picture with DALL-E on this description: {repr(description)}') return BytesIO(await image.read()) except Exception as err: logging.warning(f"Failed to generate image {repr(description)}: {repr(err)}") @@ -190,6 +191,7 @@ class AIResponder(object): headers={"Authorization": f"Bearer {self.config['leonardo-token']}"}, ) as response: await response.json() + logging.info(f'Drawed a picture with leonardo AI on this description: {repr(description)}') return image_bytes except Exception as err: logging.warning(f"Failed to generate image: {repr(err)}")