Spaces:
Paused
Paused
Update app.py
Browse files
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"
|
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="
|
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 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
|
|
|
|
|
|
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)
|