new test for GH actions

This commit is contained in:
Adam Wilson
2025-08-16 18:57:08 -06:00
parent 82c987404b
commit 1eadd81d77
12 changed files with 76 additions and 30 deletions
@@ -7,15 +7,16 @@ import time
from datetime import datetime
from typing import Any, Dict, List
from src.text_generation.common.model_id import ModelId
from src.text_generation.domain.text_generation_completion_result import TextGenerationCompletionResult
from src.text_generation.services.logging.abstract_test_run_logging_service import AbstractTestRunLoggingService
class TestRunLoggingService(AbstractTestRunLoggingService):
def __init__(self, test_id: int):
def __init__(self, test_id: int, model_id: ModelId):
self._lock = threading.Lock()
timestamp = calendar.timegm(time.gmtime())
self.log_file_path = f"./tests/logs/test_{test_id}/test_{test_id}_logs_{timestamp}.json"
self.log_file_path = f"./tests/logs/test_{test_id}/{str(model_id.value).replace("/", "_")}/test_{test_id}_logs_{timestamp}.json"
self._ensure_log_file_exists()
def _ensure_log_file_exists(self):
@@ -43,7 +43,7 @@ class TextGenerationCompletionService(
semantic_similarity_service: AbstractSemanticSimilarityService,
prompt_injection_example_service: AbstractPromptInjectionExampleService,
llm_configuration_introspection_service: AbstractLLMConfigurationIntrospectionService,
default_model_type: ModelId = ModelId.MICROSOFT_PHI_3_MINI4K_INSTRUCT.value):
default_model_type: ModelId = ModelId.MICROSOFT_PHI_3_MINI4K_INSTRUCT):
super().__init__()
self.constants = Constants()
@@ -113,7 +113,7 @@ class TextGenerationCompletionService(
self._current_model = self.factory.create_model(model_id, config)
self._current_model.load()
self._current_model_id = model_id
self._current_model_id: ModelId = model_id
self.foundation_model_pipeline = self._current_model.create_pipeline()
logger.info(f"Successfully loaded model: {model_id.value}")