From a2388933754e62ff363f76fe5cf6ab08218521a7 Mon Sep 17 00:00:00 2001 From: Adam Wilson Date: Mon, 18 Aug 2025 21:30:15 -0600 Subject: [PATCH] os.makedirs() --- .../services/logging/test_run_logging_service.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/text_generation/services/logging/test_run_logging_service.py b/src/text_generation/services/logging/test_run_logging_service.py index 72f2298a9..bd34707d2 100644 --- a/src/text_generation/services/logging/test_run_logging_service.py +++ b/src/text_generation/services/logging/test_run_logging_service.py @@ -24,8 +24,13 @@ class TestRunLoggingService(AbstractTestRunLoggingService): timestamp = calendar.timegm(time.gmtime()) base_path = os.environ.get('TEST_RUNS', '.') self.log_file_path = os.path.join(base_path, str(f"test_{test_id}/{str(model_id.value).replace("/", "_")}/{start}_{end}/test_{str(test_id).lower()}_logs_{timestamp}.json").lower()) + + # Ensure directory structure exists + os.makedirs(os.path.dirname(self.log_file_path), exist_ok=True) + self._ensure_log_file_exists() + def _ensure_log_file_exists(self): if not os.path.exists(self.log_file_path): with open(self.log_file_path, 'w') as f: