Araeynn commited on
Commit
00e2b05
1 Parent(s): efa6626

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -13
app.py CHANGED
@@ -78,6 +78,7 @@ SDT = AsyncInferenceClient(model=sdxl_turbo)
78
  PT = AsyncInferenceClient(model=proteus)
79
  LLM = AsyncInferenceClient(model="openchat/openchat-3.5-0106")
80
  RF = AsyncInferenceClient(model="stabilityai/stable-diffusion-xl-refiner-1.0")
 
81
 
82
 
83
  def ec(x, fd="<|image|>", sd="<|image|>"):
@@ -146,7 +147,6 @@ async def on_message(message):
146
  return
147
  sysp = f"""GPT4 Correct System:
148
  Instructions for Assistant:
149
- You are not the Decider. Do not use the <|res|> or <|nrs|> tags.
150
  You are lyre, a discord bot. You were made by Araeyn.
151
  Your username is lyre#9828.
152
  You must use the markdown format for your responses.
@@ -158,12 +158,7 @@ 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
- Instructions for Decider:
163
- You are Decider, a classifier, not the Assistant.
164
- You will see the conversation, and decide whether or not the Assistant should say something in the conversation.
165
- If the user mentions lyre#9828 or is trying to speak to you or continue a conversation with you, say <|res|>.
166
- If you do, say <|res|>, and if you do not, say <|nrs|>. Do not say anything after."""
167
  try:
168
  os.mkdir("data/" + guild_name)
169
  except:
@@ -191,11 +186,7 @@ async def on_message(message):
191
  )
192
  with open(f"data/{guild_name}/{msgchannel_name}", "r") as f:
193
  context = f.read()
194
- res = await LLM.text_generation(context + "<|end_of_turn|>GPT4 Correct Decider: ",
195
- stop_sequences=["<|end_of_turn|>"],
196
- max_new_tokens=48)
197
- print(res)
198
- if ("<|res|>" in res and "<|nrs|>" not in res) or guild_name == "Direct":
199
  async with msgchannel.typing():
200
  context += f"GPT4 Correct Assistant:"
201
  load = random.choice(
@@ -235,7 +226,7 @@ async def on_message(message):
235
  text=
236
  """Refining..."""
237
  )
238
- file = discord.File("image.png", filename="image.png")
239
  embed.set_image(url="attachment://image.png")
240
  await e.edit(embed=embed, attachments=[file])
241
  image = await RF.image_to_image("image.png")
 
78
  PT = AsyncInferenceClient(model=proteus)
79
  LLM = AsyncInferenceClient(model="openchat/openchat-3.5-0106")
80
  RF = AsyncInferenceClient(model="stabilityai/stable-diffusion-xl-refiner-1.0")
81
+ C = AsyncInferenceClient(model="llava-hf/llava-1.5-7b-hf")
82
 
83
 
84
  def ec(x, fd="<|image|>", sd="<|image|>"):
 
147
  return
148
  sysp = f"""GPT4 Correct System:
149
  Instructions for Assistant:
 
150
  You are lyre, a discord bot. You were made by Araeyn.
151
  Your username is lyre#9828.
152
  You must use the markdown format for your responses.
 
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:
 
186
  )
187
  with open(f"data/{guild_name}/{msgchannel_name}", "r") as f:
188
  context = f.read()
189
+ if ("Feeway" in guild_name) or guild_name == "Direct":
 
 
 
 
190
  async with msgchannel.typing():
191
  context += f"GPT4 Correct Assistant:"
192
  load = random.choice(
 
226
  text=
227
  """Refining..."""
228
  )
229
+ file = discord.File("image.png", filename="image.png", description=imgp)
230
  embed.set_image(url="attachment://image.png")
231
  await e.edit(embed=embed, attachments=[file])
232
  image = await RF.image_to_image("image.png")