|
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | 15 |
|
| 16 | +import os |
16 | 17 | import uuid |
17 | 18 | from collections import defaultdict |
18 | 19 | from pprint import pprint |
@@ -432,6 +433,7 @@ def fit(self): # noqa: C901 |
432 | 433 | self.verl_logger.log(data=val_metrics, step=self.global_steps) |
433 | 434 | val_print_to_markdown_file_path = self.config.ajet.trainer_common.val_print_to_markdown_file_path |
434 | 435 | if val_print_to_markdown_file_path: |
| 436 | + os.makedirs(os.path.dirname(val_print_to_markdown_file_path), exist_ok=True) |
435 | 437 | with open(val_print_to_markdown_file_path, mode="a+") as f: |
436 | 438 | f.write(str(val_metrics)) |
437 | 439 | f.write('\n') |
@@ -736,6 +738,7 @@ def fit(self): # noqa: C901 |
736 | 738 | metrics.update(val_metrics) |
737 | 739 | val_print_to_markdown_file_path = self.config.ajet.trainer_common.val_print_to_markdown_file_path |
738 | 740 | if val_print_to_markdown_file_path: |
| 741 | + os.makedirs(os.path.dirname(val_print_to_markdown_file_path), exist_ok=True) |
739 | 742 | with open(val_print_to_markdown_file_path, mode="a+") as f: |
740 | 743 | f.write(str(val_metrics)) |
741 | 744 | f.write('\n') |
@@ -789,6 +792,7 @@ def fit(self): # noqa: C901 |
789 | 792 | self.verl_logger.log(data=metrics, step=self.global_steps) |
790 | 793 | train_print_to_markdown_file_path = self.config.ajet.trainer_common.train_print_to_markdown_file_path |
791 | 794 | if train_print_to_markdown_file_path: |
| 795 | + os.makedirs(os.path.dirname(train_print_to_markdown_file_path), exist_ok=True) |
792 | 796 | with open(train_print_to_markdown_file_path, mode="a+") as f: |
793 | 797 | f.write(str(metrics)) |
794 | 798 | f.write('\n') |
|
0 commit comments