Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -125,22 +125,23 @@ async def on_message(message):
|
|
| 125 |
finally:
|
| 126 |
with open(f"data/{guild_name}/{msgchannel_name}", "r") as f:
|
| 127 |
context = f.read()
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
|
|
|
| 144 |
except Exception as e:
|
| 145 |
print(Fore.RED)
|
| 146 |
print(e)
|
|
|
|
| 125 |
finally:
|
| 126 |
with open(f"data/{guild_name}/{msgchannel_name}", "r") as f:
|
| 127 |
context = f.read()
|
| 128 |
+
if "Feeway" in guild_name:
|
| 129 |
+
context += f"GPT4 Correct Assistant:"
|
| 130 |
+
title = ec(context, "<title>", "</title>")[0]
|
| 131 |
+
output = LLM.text_generation(context,
|
| 132 |
+
stop_sequences=[""],
|
| 133 |
+
max_new_tokens=4096)
|
| 134 |
+
with open(f"data/{guild_name}/{msgchannel_name}", "a") as f:
|
| 135 |
+
f.write(f"GPT4 Correct Assistant: {output}<|end_of_turn|>")
|
| 136 |
+
embed = discord.Embed(title=title,
|
| 137 |
+
description=output.replace(
|
| 138 |
+
f"<title>{title}</title>", ""),
|
| 139 |
+
color=0x1E81B0)
|
| 140 |
+
embed.set_footer(
|
| 141 |
+
text=
|
| 142 |
+
"""Information or code generated by Lyre may not always be correct. Lyre was made by Araeyn."""
|
| 143 |
+
)
|
| 144 |
+
e = await message.reply(embed=embed)
|
| 145 |
except Exception as e:
|
| 146 |
print(Fore.RED)
|
| 147 |
print(e)
|