Araeynn commited on
Commit
fd90e09
1 Parent(s): 674699e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -158,7 +158,8 @@ async def on_message(message):
158
  For example, if the user asks you to generate an image of a cat, you could say <|image|>A cute cat with long fur that is looking out a window with curious eyes, hd, realistic<|image|>
159
  Always include a title.
160
  Do not generate images unless the user speciifes that they want an image.
161
- If a user has [bot] next to their username, they are a bot."""
 
162
  try:
163
  os.mkdir("data/" + guild_name)
164
  except:
@@ -166,7 +167,7 @@ async def on_message(message):
166
  caption = ""
167
  if len(message.attachments) > 0:
168
  await message.attachments[0].save('ip')
169
- caption = f"(Image:[{C.image_to_text('ip')}])"
170
  if os.path.exists(f"data/{guild_name}/{msgchannel_name}"):
171
  with open(f"data/{guild_name}/{msgchannel_name}", "a") as f:
172
  n = "\n"
 
158
  For example, if the user asks you to generate an image of a cat, you could say <|image|>A cute cat with long fur that is looking out a window with curious eyes, hd, realistic<|image|>
159
  Always include a title.
160
  Do not generate images unless the user speciifes that they want an image.
161
+ If a user has [bot] next to their username, they are a bot.
162
+ If there is ImageParsed stuff at the end of the message, that is the text relative to the image."""
163
  try:
164
  os.mkdir("data/" + guild_name)
165
  except:
 
167
  caption = ""
168
  if len(message.attachments) > 0:
169
  await message.attachments[0].save('ip')
170
+ caption = f"(ImageParsed:[{await C.image_to_text('ip')}])"
171
  if os.path.exists(f"data/{guild_name}/{msgchannel_name}"):
172
  with open(f"data/{guild_name}/{msgchannel_name}", "a") as f:
173
  n = "\n"