refactor: update import paths and benchmark discovery
Updated import paths to use direct module references instead of relative paths. Implemented dynamic benchmark discovery based on the contents of the tests/ directory, allowing for more flexible benchmark configuration without requiring code changes. This change improves maintainability and makes it easier to add new benchmarks.
This commit is contained in:
@@ -13,7 +13,7 @@ from pathlib import Path
|
||||
# Добавляем путь к исходникам, чтобы импортировать base
|
||||
sys.path.insert(0, str(Path(__file__).parent.parent))
|
||||
|
||||
from src.benchmarks.base import TEST_SEPARATOR
|
||||
from benchmark import TEST_SEPARATOR
|
||||
|
||||
def convert_tests(test_dir: str) -> None:
|
||||
"""Конвертирует все тесты в указанной директории."""
|
||||
|
||||
@@ -19,7 +19,7 @@ from pymongo import MongoClient
|
||||
sys.path.insert(0, str(Path(__file__).parent.parent))
|
||||
|
||||
from src.constants import TEST_SEPARATOR
|
||||
from src.models.ollama_client import OllamaClient
|
||||
from ollama_client import OllamaClient
|
||||
|
||||
def sanitize_filename(filename: str) -> str:
|
||||
"""
|
||||
|
||||
@@ -20,7 +20,7 @@ from typing import Dict, List, Optional
|
||||
# Добавляем путь к исходникам, чтобы импортировать ollama_client
|
||||
sys.path.insert(0, str(Path(__file__).parent.parent))
|
||||
|
||||
from src.models.ollama_client import OllamaClient
|
||||
from ollama_client import OllamaClient
|
||||
from src.constants import TEST_SEPARATOR
|
||||
|
||||
def generate_translation_test(ollama: OllamaClient, model: str) -> Dict[str, str]:
|
||||
|
||||
Reference in New Issue
Block a user