Araeynn commited on
Commit
1e804e0
·
verified ·
1 Parent(s): 0c3ce67

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -22
app.py CHANGED
@@ -25,7 +25,7 @@ def syncMessages():
25
  hours, remainder = divmod(int(delta_uptime.total_seconds()), 3600)
26
  minutes, seconds = divmod(remainder, 60)
27
  days, hours = divmod(hours, 24)
28
- st.markdown(f":violet[Online Time]: :green[{days:02d}]d | :green[{hours:02d}]h | :green[{minutes:02d}]m | :green[{seconds:02d}]s")
29
  dirs = st.tabs(os.listdir("data"))
30
  i = -1
31
  for dir in os.listdir("data"):
@@ -71,7 +71,7 @@ HF_TOKEN = os.environ["HF_TOKEN"]
71
 
72
  login(HF_TOKEN)
73
 
74
- SD = InferenceClient(model="stabilityai/stable-diffusion-2-1")
75
  LLM = InferenceClient(model="openchat/openchat-3.5-0106")
76
  RF = InferenceClient(model="stabilityai/stable-diffusion-xl-refiner-1.0")
77
 
@@ -147,8 +147,10 @@ async def on_message(message):
147
  Your title must summarize the user's message.
148
  If the user asks you to generate an image, use the start tag <|image|> and the end tag <|image|> around the prompt to generate it. Put this at the end of your response. Do not use a link for the image.
149
  For example, if the user asks you to generate an image of a cat, you would say <|image|>A cute cat with long fur that is looking out a window with curious eyes.<|image|>
 
150
  Always include a title.
151
- Do not generate images unless the user speciifes that they want an image."""
 
152
  try:
153
  os.mkdir("data/" + guild_name)
154
  except:
@@ -201,26 +203,28 @@ async def on_message(message):
201
  )
202
 
203
  e = await message.reply(embed=embed)
204
- print(imgp)
205
  if imgp != "":
206
- image = SD.text_to_image(imgp)
207
- image.save("image.png")
208
- embed.set_footer(
209
- text=
210
- """Refining..."""
211
- )
212
- file = discord.File("image.png", filename="image.png")
213
- embed.set_image(url="attachment://image.png")
214
- await e.edit(embed=embed, attachments=[file])
215
- image = RF.image_to_image("image.png")
216
- embed.set_footer(
217
- text=
218
- """Information or code generated by Lyre may not always be correct. Lyre was made by Araeyn."""
219
- )
220
- image.save("image.png")
221
- file = discord.File("image.png", filename="image.png")
222
- embed.set_image(url="attachment://image.png")
223
- await e.edit(embed=embed, attachments=[file])
 
 
 
224
 
225
  except Exception as e:
226
  print(e)
 
25
  hours, remainder = divmod(int(delta_uptime.total_seconds()), 3600)
26
  minutes, seconds = divmod(remainder, 60)
27
  days, hours = divmod(hours, 24)
28
+ st.markdown(f"`[Online Time]: [{days:02d}]d | [{hours:02d}]h | [{minutes:02d}]m | [{seconds:02d}]s`")
29
  dirs = st.tabs(os.listdir("data"))
30
  i = -1
31
  for dir in os.listdir("data"):
 
71
 
72
  login(HF_TOKEN)
73
 
74
+ SD = InferenceClient(model="dataautogpt3/ProteusV0.2")
75
  LLM = InferenceClient(model="openchat/openchat-3.5-0106")
76
  RF = InferenceClient(model="stabilityai/stable-diffusion-xl-refiner-1.0")
77
 
 
147
  Your title must summarize the user's message.
148
  If the user asks you to generate an image, use the start tag <|image|> and the end tag <|image|> around the prompt to generate it. Put this at the end of your response. Do not use a link for the image.
149
  For example, if the user asks you to generate an image of a cat, you would say <|image|>A cute cat with long fur that is looking out a window with curious eyes.<|image|>
150
+ Use the keywords 'best quality, HD, ~*~aesthetic~*~' in your prompt to improve it.
151
  Always include a title.
152
+ Do not generate images unless the user speciifes that they want an image.
153
+ Talk like the user does,"""
154
  try:
155
  os.mkdir("data/" + guild_name)
156
  except:
 
203
  )
204
 
205
  e = await message.reply(embed=embed)
 
206
  if imgp != "":
207
+ try:
208
+ image = SD.text_to_image(imgp)
209
+ image.save("image.png")
210
+ embed.set_footer(
211
+ text=
212
+ """Refining..."""
213
+ )
214
+ file = discord.File("image.png", filename="image.png")
215
+ embed.set_image(url="attachment://image.png")
216
+ await e.edit(embed=embed, attachments=[file])
217
+ image = RF.image_to_image("image.png")
218
+ embed.set_footer(
219
+ text=
220
+ """Information or code generated by Lyre may not always be correct. Lyre was made by Araeyn."""
221
+ )
222
+ image.save("image.png")
223
+ file = discord.File("image.png", filename="image.png")
224
+ embed.set_image(url="attachment://image.png")
225
+ await e.edit(embed=embed, attachments=[file])
226
+ except:
227
+ print(image)
228
 
229
  except Exception as e:
230
  print(e)