Spaces:
Sleeping
Sleeping
xeon27
commited on
Commit
·
ca5fb3d
1
Parent(s):
6eaffc5
Add script for log file map creation
Browse files- create_log_file_map.py +36 -0
create_log_file_map.py
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json
|
| 2 |
+
import os
|
| 3 |
+
|
| 4 |
+
from collections import defaultdict
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
def main():
|
| 8 |
+
|
| 9 |
+
base_bm_input_path = "./base_benchmarking_logs"
|
| 10 |
+
agentic_bm_input_path = "./agentic_benchmarking_logs"
|
| 11 |
+
|
| 12 |
+
log_file_map = defaultdict()
|
| 13 |
+
|
| 14 |
+
for model_name in os.listdir(base_bm_input_path):
|
| 15 |
+
log_file_map[model_name] = defaultdict(str)
|
| 16 |
+
if os.path.isdir(os.path.join(base_bm_input_path, model_name)):
|
| 17 |
+
for task_log_file in os.listdir(os.path.join(base_bm_input_path, model_name)):
|
| 18 |
+
with open(os.path.join(base_bm_input_path, model_name, task_log_file), "r") as f:
|
| 19 |
+
result = json.load(f)
|
| 20 |
+
task_name = result["eval"]["task"].split("/")[-1]
|
| 21 |
+
log_file_map[model_name][task_name] = task_log_file
|
| 22 |
+
|
| 23 |
+
for model_name in os.listdir(agentic_bm_input_path):
|
| 24 |
+
if os.path.isdir(os.path.join(agentic_bm_input_path, model_name)):
|
| 25 |
+
for task_log_file in os.listdir(os.path.join(agentic_bm_input_path, model_name)):
|
| 26 |
+
with open(os.path.join(agentic_bm_input_path, model_name, task_log_file), "r") as f:
|
| 27 |
+
result = json.load(f)
|
| 28 |
+
task_name = result["eval"]["task"].split("/")[-1]
|
| 29 |
+
log_file_map[model_name][task_name] = task_log_file
|
| 30 |
+
|
| 31 |
+
with open("./inspect_log_file_names.json", "w") as f:
|
| 32 |
+
json.dump(log_file_map, f, indent=4)
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
if __name__ == "__main__":
|
| 36 |
+
main()
|