Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -112,7 +112,7 @@ async def on_message(message):
|
|
112 |
os.mkdir("data/" + guild_name)
|
113 |
with open(f"data/{guild_name}/{msgchannel_name}", "w") as f:
|
114 |
f.write(
|
115 |
-
f"GPT4 Correct system: {sysp}
|
116 |
)
|
117 |
except:
|
118 |
f = open(f"data/{guild_name}/{msgchannel_name}", "w")
|
@@ -120,18 +120,18 @@ async def on_message(message):
|
|
120 |
with open(f"data/{guild_name}/{msgchannel_name}", "a") as f:
|
121 |
n = "\n"
|
122 |
f.write(
|
123 |
-
f"""GPT4 Correct {message.author.name}: {message.content.strip(n)}"""
|
124 |
)
|
125 |
finally:
|
126 |
with open(f"data/{guild_name}/{msgchannel_name}", "r") as f:
|
127 |
context = f.read()
|
128 |
-
context += f"GPT4 Correct Assistant: {message.content}
|
129 |
title = ec(context, "<title>", "</title>")[0]
|
130 |
output = LLM.text_generation(context,
|
131 |
stop_sequences=[""],
|
132 |
max_new_tokens=4096)
|
133 |
with open(f"data/{guild_name}/{msgchannel_name}", "a") as f:
|
134 |
-
f.write(f"GPT4 Correct Assistant: {output}")
|
135 |
embed = discord.Embed(title=title,
|
136 |
description=output.replace(
|
137 |
f"<title>{title}</title>", ""),
|
|
|
112 |
os.mkdir("data/" + guild_name)
|
113 |
with open(f"data/{guild_name}/{msgchannel_name}", "w") as f:
|
114 |
f.write(
|
115 |
+
f"GPT4 Correct system: {sysp}<|end_of_turn|>GPT4 Correct {message.author}: {message.content}<|end_of_turn|>"
|
116 |
)
|
117 |
except:
|
118 |
f = open(f"data/{guild_name}/{msgchannel_name}", "w")
|
|
|
120 |
with open(f"data/{guild_name}/{msgchannel_name}", "a") as f:
|
121 |
n = "\n"
|
122 |
f.write(
|
123 |
+
f"""GPT4 Correct {message.author.name}: {message.content.strip(n)}<|end_of_turn|>"""
|
124 |
)
|
125 |
finally:
|
126 |
with open(f"data/{guild_name}/{msgchannel_name}", "r") as f:
|
127 |
context = f.read()
|
128 |
+
context += f"GPT4 Correct Assistant: {message.content}<|end_of_turn|>"
|
129 |
title = ec(context, "<title>", "</title>")[0]
|
130 |
output = LLM.text_generation(context,
|
131 |
stop_sequences=[""],
|
132 |
max_new_tokens=4096)
|
133 |
with open(f"data/{guild_name}/{msgchannel_name}", "a") as f:
|
134 |
+
f.write(f"GPT4 Correct Assistant: {output}<|end_of_turn|>")
|
135 |
embed = discord.Embed(title=title,
|
136 |
description=output.replace(
|
137 |
f"<title>{title}</title>", ""),
|