From 5b27527ad0e386194805d1aa0bce6722f16e2b5f Mon Sep 17 00:00:00 2001 From: Nuno Miguel Guerreiro <56764424+nunonmg@users.noreply.github.com> Date: Tue, 20 Aug 2024 11:10:25 +0100 Subject: [PATCH] Update datasets.py to create "last_run_prepared" folder in case it has not been created yet. --- src/axolotl/datasets.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/axolotl/datasets.py b/src/axolotl/datasets.py index 52571f0d5a..c21c991b72 100644 --- a/src/axolotl/datasets.py +++ b/src/axolotl/datasets.py @@ -153,6 +153,9 @@ def process(self, dataset): # find current time current_time = time.strftime("%Y%m%d-%H%M%S") + # Create directory if it doesn't exist + if not os.path.exists(main_dir + '/axolotl/last_run_prepared'): + os.makedirs(main_dir + '/axolotl/last_run_prepared') # Colorize and save to an HTML file with open(main_dir + '/axolotl/last_run_prepared/colorized_samples' + current_time + '.html', 'w') as f: f.write('
\n')