Spaces:
Runtime error
Runtime error
Commit
·
dace4e2
1
Parent(s):
881fd3f
Fix typo and move upload
Browse files
app.py
CHANGED
|
@@ -137,6 +137,21 @@ if __name__ == "__main__":
|
|
| 137 |
need_recalc = True
|
| 138 |
|
| 139 |
if need_recalc:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
with open(PERSISTENT_FILE_CHECK_PATH, "w", encoding="utf-8") as file:
|
| 141 |
file.write("0")
|
| 142 |
API.upload_file(
|
|
@@ -146,11 +161,6 @@ if __name__ == "__main__":
|
|
| 146 |
repo_type="dataset",
|
| 147 |
token=HF_TOKEN_PRIVATE,
|
| 148 |
)
|
| 149 |
-
gen_judgement_file = os.path.join(HF_HOME, "src/gen/gen_judgement.py")
|
| 150 |
-
subprocess.run(["python3", gen_judgement_file], check=True)
|
| 151 |
-
|
| 152 |
-
show_result_file = os.path.join(HF_HOME, "src/gen/show_result.py")
|
| 153 |
-
subprocess.run(["python3", show_result_file, "--output"], check=True)
|
| 154 |
|
| 155 |
scheduler = BackgroundScheduler()
|
| 156 |
scheduler.add_job(update_board, "interval", minutes=10)
|
|
|
|
| 137 |
need_recalc = True
|
| 138 |
|
| 139 |
if need_recalc:
|
| 140 |
+
# does it need to be subprocess
|
| 141 |
+
# no
|
| 142 |
+
# was the not working code before using ones
|
| 143 |
+
# yes
|
| 144 |
+
# do i want to actually use my brain?
|
| 145 |
+
gen_judgement_file = os.path.join(HF_HOME, "src/gen/gen_judgment.py")
|
| 146 |
+
subprocess.run(["python3", gen_judgement_file], check=True)
|
| 147 |
+
|
| 148 |
+
show_result_file = os.path.join(HF_HOME, "src/gen/show_result.py")
|
| 149 |
+
subprocess.run(["python3", show_result_file, "--output"], check=True)
|
| 150 |
+
|
| 151 |
+
# finished creating the results
|
| 152 |
+
# may lead to multiple attempts to get judements
|
| 153 |
+
# if code above throws error
|
| 154 |
+
# move to before judgement to saafeguard from that
|
| 155 |
with open(PERSISTENT_FILE_CHECK_PATH, "w", encoding="utf-8") as file:
|
| 156 |
file.write("0")
|
| 157 |
API.upload_file(
|
|
|
|
| 161 |
repo_type="dataset",
|
| 162 |
token=HF_TOKEN_PRIVATE,
|
| 163 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 164 |
|
| 165 |
scheduler = BackgroundScheduler()
|
| 166 |
scheduler.add_job(update_board, "interval", minutes=10)
|