Spaces:
Running
Running
hanhainebula
commited on
Commit
·
cf423b1
1
Parent(s):
2856c7d
update backend.py
Browse files- src/backend.py +16 -15
src/backend.py
CHANGED
@@ -22,7 +22,7 @@ logger = logging.getLogger(__name__)
|
|
22 |
logging.basicConfig(
|
23 |
level=logging.WARNING,
|
24 |
datefmt='%Y-%m-%d %H:%M:%S',
|
25 |
-
format='%(asctime)s
|
26 |
force=True
|
27 |
)
|
28 |
|
@@ -342,20 +342,21 @@ def pull_search_results(
|
|
342 |
shutil.rmtree(unzip_target_dir)
|
343 |
|
344 |
# update submit infos
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
|
|
359 |
|
360 |
# Wait for the next update
|
361 |
logger.warning(f"Wait for {time_duration} seconds for the next update ...")
|
|
|
22 |
logging.basicConfig(
|
23 |
level=logging.WARNING,
|
24 |
datefmt='%Y-%m-%d %H:%M:%S',
|
25 |
+
format='%(asctime)s | %(name)s | %(levelname)s: %(message)s',
|
26 |
force=True
|
27 |
)
|
28 |
|
|
|
342 |
shutil.rmtree(unzip_target_dir)
|
343 |
|
344 |
# update submit infos
|
345 |
+
if new_file_paths != cur_file_paths:
|
346 |
+
cur_file_paths = new_file_paths
|
347 |
+
submit_infos_list = get_submit_infos_list(cur_file_paths, hf_eval_results_repo_dir)
|
348 |
+
submit_infos_save_path = os.path.join(submit_infos_dir, submit_infos_file_name)
|
349 |
+
with open(submit_infos_save_path, 'w', encoding='utf-8') as f:
|
350 |
+
json.dump(submit_infos_list, f, ensure_ascii=False, indent=4)
|
351 |
+
|
352 |
+
# Commit the updated submit infos
|
353 |
+
API.upload_folder(
|
354 |
+
repo_id=SUBMIT_INFOS_REPO,
|
355 |
+
folder_path=submit_infos_dir,
|
356 |
+
path_in_repo=None,
|
357 |
+
commit_message="Update submission infos",
|
358 |
+
repo_type="dataset"
|
359 |
+
)
|
360 |
|
361 |
# Wait for the next update
|
362 |
logger.warning(f"Wait for {time_duration} seconds for the next update ...")
|