Spaces:
Sleeping
Sleeping
| import os | |
| import json | |
| import pandas as pd | |
| from constants import RESULTS_DIR | |
| def load_all_results(): | |
| all_data = [] | |
| for file in os.listdir(RESULTS_DIR): | |
| if file.endswith(".json"): | |
| with open(os.path.join(RESULTS_DIR, file), "r") as f: | |
| data = json.load(f) | |
| if isinstance(data, list): | |
| all_data.extend(data) | |
| elif isinstance(data, dict): | |
| all_data.append(data) | |
| return pd.DataFrame(all_data) | |