Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -126,17 +126,18 @@ async def on_message(message):
|
|
| 126 |
try:
|
| 127 |
os.mkdir("data/" + guild_name)
|
| 128 |
except:
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
)
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
|
|
|
| 140 |
finally:
|
| 141 |
with open(f"data/{guild_name}/{msgchannel_name}", "r") as f:
|
| 142 |
context = f.read()
|
|
|
|
| 126 |
try:
|
| 127 |
os.mkdir("data/" + guild_name)
|
| 128 |
except:
|
| 129 |
+
pass
|
| 130 |
+
try:
|
| 131 |
+
with open(f"data/{guild_name}/{msgchannel_name}", "a") as f:
|
| 132 |
+
n = "\n"
|
| 133 |
+
f.write(
|
| 134 |
+
f"""GPT4 Correct {message.author.name}: {message.content.strip(n)}<|end_of_turn|>"""
|
| 135 |
+
)
|
| 136 |
+
except error:
|
| 137 |
+
with open(f"data/{guild_name}/{msgchannel_name}", "w") as f:
|
| 138 |
+
f.write(
|
| 139 |
+
f"GPT4 Correct system: {sysp}<|end_of_turn|>GPT4 Correct {message.author}: {message.content}<|end_of_turn|>"
|
| 140 |
+
)
|
| 141 |
finally:
|
| 142 |
with open(f"data/{guild_name}/{msgchannel_name}", "r") as f:
|
| 143 |
context = f.read()
|