Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -13,36 +13,6 @@ from huggingface_hub import InferenceClient, login
|
|
13 |
import time
|
14 |
import os
|
15 |
|
16 |
-
|
17 |
-
ph = st.empty()
|
18 |
-
|
19 |
-
async def syncMessages():
|
20 |
-
print(os.listdir(f"data"))
|
21 |
-
if os.listdir("data") == []:
|
22 |
-
return 0
|
23 |
-
ph.empty()
|
24 |
-
with ph.container():
|
25 |
-
dirs = st.tabs(os.listdir("data"))
|
26 |
-
i = -1
|
27 |
-
for dir in os.listdir("data"):
|
28 |
-
i += 1
|
29 |
-
with dirs[i]:
|
30 |
-
print(i, os.listdir(f"data/{dir}"))
|
31 |
-
if os.listdir(f"data/{dir}") == []:
|
32 |
-
return 0
|
33 |
-
files = st.tabs(os.listdir("data/" + dir))
|
34 |
-
k = -1
|
35 |
-
for file in os.listdir("data/" + dir):
|
36 |
-
k += 1
|
37 |
-
with files[k]:
|
38 |
-
with open(f"data/{dir}/{file}", "r") as f:
|
39 |
-
o = f.read().split("<|end_of_turn|>")
|
40 |
-
print(o)
|
41 |
-
for item in o:
|
42 |
-
if item == "":
|
43 |
-
continue
|
44 |
-
item = item.split(": ", 1)
|
45 |
-
st.markdown(f":blue[{item[0].split('GPT4 Correct ')[1]}]: {item[1]}")
|
46 |
lock_file_path = "test.txt"
|
47 |
|
48 |
if not os.path.exists(lock_file_path):
|
@@ -81,6 +51,39 @@ client = discord.Client(intents=intents)
|
|
81 |
|
82 |
launch_time = datetime.datetime.utcnow()
|
83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
@client.event
|
85 |
async def on_ready():
|
86 |
if clone:
|
@@ -112,6 +115,10 @@ async def presence():
|
|
112 |
)
|
113 |
|
114 |
|
|
|
|
|
|
|
|
|
115 |
@client.event
|
116 |
async def on_message(message):
|
117 |
if clone:
|
|
|
13 |
import time
|
14 |
import os
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
lock_file_path = "test.txt"
|
17 |
|
18 |
if not os.path.exists(lock_file_path):
|
|
|
51 |
|
52 |
launch_time = datetime.datetime.utcnow()
|
53 |
|
54 |
+
|
55 |
+
|
56 |
+
ph = st.empty()
|
57 |
+
|
58 |
+
async def syncMessages():
|
59 |
+
print(os.listdir(f"data"))
|
60 |
+
if os.listdir("data") == []:
|
61 |
+
return 0
|
62 |
+
ph.empty()
|
63 |
+
with ph.container():
|
64 |
+
dirs = st.tabs(os.listdir("data"))
|
65 |
+
i = -1
|
66 |
+
for dir in os.listdir("data"):
|
67 |
+
i += 1
|
68 |
+
with dirs[i]:
|
69 |
+
print(i, os.listdir(f"data/{dir}"))
|
70 |
+
if os.listdir(f"data/{dir}") == []:
|
71 |
+
return 0
|
72 |
+
files = st.tabs(os.listdir("data/" + dir))
|
73 |
+
k = -1
|
74 |
+
for file in os.listdir("data/" + dir):
|
75 |
+
k += 1
|
76 |
+
with files[k]:
|
77 |
+
with open(f"data/{dir}/{file}", "r") as f:
|
78 |
+
o = f.read().split("<|end_of_turn|>")
|
79 |
+
print(o)
|
80 |
+
for item in o:
|
81 |
+
if item == "":
|
82 |
+
continue
|
83 |
+
item = item.split(": ", 1)
|
84 |
+
st.markdown(f":blue[{item[0].split('GPT4 Correct ')[1]}]: {item[1]}")
|
85 |
+
|
86 |
+
|
87 |
@client.event
|
88 |
async def on_ready():
|
89 |
if clone:
|
|
|
115 |
)
|
116 |
|
117 |
|
118 |
+
@client.event
|
119 |
+
async def on_disconnect():
|
120 |
+
print("Disconnected, Clone status:", clone)
|
121 |
+
|
122 |
@client.event
|
123 |
async def on_message(message):
|
124 |
if clone:
|