(data_name, split="test")
| 4 | |
| 5 | @lru_cache(maxsize=None) |
| 6 | def load_data(data_name, split="test"): |
| 7 | # Determine file path |
| 8 | file_path = f"experiment/data/{data_name}/{split}.json" |
| 9 | |
| 10 | # Load data from JSON file |
| 11 | if os.path.exists(file_path): |
| 12 | print(file_path) |
| 13 | with open(file_path, 'r') as f: |
| 14 | data = json.load(f) |
| 15 | else: |
| 16 | raise FileNotFoundError(f"Could not load {data_name} {split} locally") |
| 17 | |
| 18 | return data |
no test coverage detected