Araeynn commited on
Commit
1bd8e61
1 Parent(s): ef8cf93

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -12
app.py CHANGED
@@ -144,17 +144,23 @@ async def on_message(message):
144
  s = f":green[{message.author}]: :violet[{message.content}] :blue[{msgchannel_name}] :orange[{guild_name}]"
145
  if message.author == client.user:
146
  return
147
- sysp = f"""GPT4 Correct System: You are lr, a discord bot. You were made by Araeyn.
148
- You must use the markdown format for your responses.
149
- Do not excessively use bullet points.
150
- Use emojis at the start of your responses.
151
- Use <|title|> at the start of your title for the response and <|title|> at the end of the title.
152
- Your title is a conversation name that ChatGPT would make for the response and question.
153
- 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.
154
- 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|>
155
- Always include a title.
156
- Do not generate images unless the user speciifes that they want an image.
157
- If a user has [bot] next to their username, they are a bot."""
 
 
 
 
 
 
158
  try:
159
  os.mkdir("data/" + guild_name)
160
  except:
@@ -182,7 +188,10 @@ async def on_message(message):
182
  )
183
  with open(f"data/{guild_name}/{msgchannel_name}", "r") as f:
184
  context = f.read()
185
- if "Feeway" in guild_name or guild_name == "Direct":
 
 
 
186
  async with msgchannel.typing():
187
  context += f"GPT4 Correct Assistant:"
188
  load = random.choice(
 
144
  s = f":green[{message.author}]: :violet[{message.content}] :blue[{msgchannel_name}] :orange[{guild_name}]"
145
  if message.author == client.user:
146
  return
147
+ sysp = f"""GPT4 Correct System:
148
+ Instructions for Assistant:
149
+ You are lr, a discord bot. You were made by Araeyn.
150
+ You must use the markdown format for your responses.
151
+ Do not excessively use bullet points.
152
+ Use emojis at the start of your responses.
153
+ Use <|title|> at the start of your title for the response and <|title|> at the end of the title.
154
+ Your title is a conversation name that ChatGPT would make for the response and question.
155
+ 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.
156
+ 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|>
157
+ Always include a title.
158
+ Do not generate images unless the user speciifes that they want an image.
159
+ If a user has [bot] next to their username, they are a bot.
160
+ Instructions for Decider:
161
+ You are decide, a classifier.
162
+ You will see the conversation, and decide whether or not the Assistant should say something in the conversation.
163
+ If you do, say <|res|>, and if you do not, say <|nrs|>"""
164
  try:
165
  os.mkdir("data/" + guild_name)
166
  except:
 
188
  )
189
  with open(f"data/{guild_name}/{msgchannel_name}", "r") as f:
190
  context = f.read()
191
+ res = await LLM.text_generation(context,
192
+ stop_sequences=["<|end_of_turn|>"],
193
+ max_new_tokens=48)
194
+ if ("<|res|>" in res and "<|nrs|>" not in res) or guild_name == "Direct":
195
  async with msgchannel.typing():
196
  context += f"GPT4 Correct Assistant:"
197
  load = random.choice(