Spaces:
Sleeping
Sleeping
Yoon-gu Hwang
commited on
Commit
·
04b5b70
1
Parent(s):
6389c5c
기록은 저장하지 말자
Browse files
app.py
CHANGED
@@ -174,6 +174,7 @@ with gr.Blocks() as demo:
|
|
174 |
infos[user].best_time = min(time.time() - infos[user].time, infos[user].best_time)
|
175 |
infos[user].best_time = round(infos[user].best_time, 2)
|
176 |
infos[user].comment = f"{gen.replace(' ', '')}+{types.replace(' ', '')}"
|
|
|
177 |
with open("infos.json", "w") as f:
|
178 |
json.dump({k: v.model_dump() for k, v in infos.items()}, f, indent=4, ensure_ascii=False)
|
179 |
with open("users.json", "w") as f:
|
@@ -182,7 +183,6 @@ with gr.Blocks() as demo:
|
|
182 |
artifact.add_file("infos.json")
|
183 |
artifact.add_file("users.json")
|
184 |
run.log_artifact(artifact)
|
185 |
-
infos[user].history = []
|
186 |
|
187 |
infos[user].history.append((message, bot_message))
|
188 |
leader_board = sorted(infos.items(), key=lambda x: (x[1].best_score, -x[1].best_time), reverse=True)
|
|
|
174 |
infos[user].best_time = min(time.time() - infos[user].time, infos[user].best_time)
|
175 |
infos[user].best_time = round(infos[user].best_time, 2)
|
176 |
infos[user].comment = f"{gen.replace(' ', '')}+{types.replace(' ', '')}"
|
177 |
+
infos[user].history = []
|
178 |
with open("infos.json", "w") as f:
|
179 |
json.dump({k: v.model_dump() for k, v in infos.items()}, f, indent=4, ensure_ascii=False)
|
180 |
with open("users.json", "w") as f:
|
|
|
183 |
artifact.add_file("infos.json")
|
184 |
artifact.add_file("users.json")
|
185 |
run.log_artifact(artifact)
|
|
|
186 |
|
187 |
infos[user].history.append((message, bot_message))
|
188 |
leader_board = sorted(infos.items(), key=lambda x: (x[1].best_score, -x[1].best_time), reverse=True)
|