Araeynn commited on
Commit
706ea24
·
verified ·
1 Parent(s): 1e804e0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -9,7 +9,7 @@ import discord
9
  from discord.ext import tasks
10
  from PIL import Image
11
  import streamlit as st
12
- from huggingface_hub import InferenceClient, login
13
  import time
14
  import os
15
 
@@ -71,9 +71,9 @@ HF_TOKEN = os.environ["HF_TOKEN"]
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
 
78
 
79
  def ec(x, fd="<|image|>", sd="<|image|>"):
@@ -205,7 +205,7 @@ async def on_message(message):
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=
@@ -214,7 +214,7 @@ async def on_message(message):
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."""
 
9
  from discord.ext import tasks
10
  from PIL import Image
11
  import streamlit as st
12
+ from huggingface_hub import AsyncInferenceClient, login
13
  import time
14
  import os
15
 
 
71
 
72
  login(HF_TOKEN)
73
 
74
+ SD = AsyncInferenceClient(model="dataautogpt3/ProteusV0.2")
75
+ LLM = AsyncInferenceClient(model="openchat/openchat-3.5-0106")
76
+ RF = AsyncInferenceClient(model="stabilityai/stable-diffusion-xl-refiner-1.0")
77
 
78
 
79
  def ec(x, fd="<|image|>", sd="<|image|>"):
 
205
  e = await message.reply(embed=embed)
206
  if imgp != "":
207
  try:
208
+ image = await SD.text_to_image(imgp)
209
  image.save("image.png")
210
  embed.set_footer(
211
  text=
 
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 = await 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."""