(result_file: Path)
| 34 | |
| 35 | |
| 36 | def load_result(result_file: Path) -> list: |
| 37 | if not result_file.exists(): |
| 38 | os.makedirs(result_file.parent, exist_ok=True) |
| 39 | with open(result_file, "w", encoding="utf-8") as file: |
| 40 | json.dump([], file) |
| 41 | with open(result_file, "r", encoding="utf-8") as file: |
| 42 | return json.load(file) |
| 43 | |
| 44 | |
| 45 | def dataloader(data_list, batch_size, i_batch): |