Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -170,11 +170,10 @@ async def on_message(message:discord.Message):
|
|
170 |
)
|
171 |
f.write(s)
|
172 |
if client.user in message.mentions or guild_name == "Direct":
|
173 |
-
with open(os.path.join(guild_name, f"{msgchannel_name}.txt"), "a") as f:
|
174 |
-
f.write("GPT4 Correct Assistant: ")
|
175 |
async with msgchannel.typing():
|
176 |
with open(os.path.join(guild_name, f"{msgchannel_name}.txt"), "r") as f:
|
177 |
o = f.read()
|
|
|
178 |
y = query({"inputs": o})
|
179 |
r = y[0]["generated_text"][len(o):]
|
180 |
title = extract_content(r, first_delimiter="<title>", second_delimiter="</title>")[0]
|
@@ -202,6 +201,7 @@ async def on_message(message:discord.Message):
|
|
202 |
embed.description = r
|
203 |
await e.edit(embed=embed)
|
204 |
with open(os.path.join(guild_name, f"{msgchannel_name}.txt"), "a") as f:
|
|
|
205 |
f.write(r)
|
206 |
f.write("<|end_of_turn|>")
|
207 |
if "<image>" in r and "</image>" in r:
|
|
|
170 |
)
|
171 |
f.write(s)
|
172 |
if client.user in message.mentions or guild_name == "Direct":
|
|
|
|
|
173 |
async with msgchannel.typing():
|
174 |
with open(os.path.join(guild_name, f"{msgchannel_name}.txt"), "r") as f:
|
175 |
o = f.read()
|
176 |
+
o += "GPT4 Correct Assistant: "
|
177 |
y = query({"inputs": o})
|
178 |
r = y[0]["generated_text"][len(o):]
|
179 |
title = extract_content(r, first_delimiter="<title>", second_delimiter="</title>")[0]
|
|
|
201 |
embed.description = r
|
202 |
await e.edit(embed=embed)
|
203 |
with open(os.path.join(guild_name, f"{msgchannel_name}.txt"), "a") as f:
|
204 |
+
f.write("GPT4 Correct Assistant: ")
|
205 |
f.write(r)
|
206 |
f.write("<|end_of_turn|>")
|
207 |
if "<image>" in r and "</image>" in r:
|