diff --git a/src/benchmarks/__pycache__/base.cpython-313.pyc b/src/benchmarks/__pycache__/base.cpython-313.pyc deleted file mode 100644 index 456c37e..0000000 Binary files a/src/benchmarks/__pycache__/base.cpython-313.pyc and /dev/null differ diff --git a/src/benchmarks/__pycache__/codegen.cpython-313.pyc b/src/benchmarks/__pycache__/codegen.cpython-313.pyc deleted file mode 100644 index e6dad8e..0000000 Binary files a/src/benchmarks/__pycache__/codegen.cpython-313.pyc and /dev/null differ diff --git a/src/benchmarks/__pycache__/summarization.cpython-313.pyc b/src/benchmarks/__pycache__/summarization.cpython-313.pyc deleted file mode 100644 index 5c0fc70..0000000 Binary files a/src/benchmarks/__pycache__/summarization.cpython-313.pyc and /dev/null differ diff --git a/src/benchmarks/__pycache__/translation.cpython-313.pyc b/src/benchmarks/__pycache__/translation.cpython-313.pyc deleted file mode 100644 index f34c1bc..0000000 Binary files a/src/benchmarks/__pycache__/translation.cpython-313.pyc and /dev/null differ diff --git a/src/benchmarks/base.py b/src/benchmarks/base.py index 4a4e9cf..81520be 100644 --- a/src/benchmarks/base.py +++ b/src/benchmarks/base.py @@ -1,14 +1,9 @@ import logging import time -import os -import json from typing import Dict, Any, List from abc import ABC, abstractmethod from models.ollama_client import OllamaClient -# Импортируем константы -from constants import TEST_SEPARATOR - class Benchmark(ABC): """Базовый класс для всех бенчмарков.""" @@ -46,13 +41,14 @@ class Benchmark(ABC): """ pass - def run(self, ollama_client: OllamaClient, model_name: str, num_ctx: int = 32000, context_size: int = None) -> Dict[str, Any]: + def run(self, ollama_client: OllamaClient, model_name: str, context_size: int = 32000) -> Dict[str, Any]: """ Запуск бенчмарка. Args: ollama_client: Клиент для работы с Ollama model_name: Название модели + context_size: Размер контекста для модели Returns: Результаты бенчмарка @@ -65,6 +61,7 @@ class Benchmark(ABC): for i, test_case in enumerate(test_cases, 1): try: self.logger.info(f"Running test case {i}/{len(test_cases)} for {self.name}") + self.logger.info(f"Test name: {test_case['name']}") # Замер времени start_time = time.time() @@ -78,7 +75,7 @@ class Benchmark(ABC): # Для Ollama параметры контекста передаются в options options['num_ctx'] = context_size self.logger.debug(f"Setting context size to {context_size}") - + self.logger.debug(f"About to call generate with model={model_name}, prompt length={len(prompt)}, options={options}") model_response = ollama_client.generate( model=model_name, diff --git a/src/main.py b/src/main.py index eab4207..5f6da71 100644 --- a/src/main.py +++ b/src/main.py @@ -26,6 +26,7 @@ def run_benchmarks(ollama_client: OllamaClient, model_name: str, benchmarks: Lis ollama_client: Клиент для работы с Ollama model_name: Название модели benchmarks: Список имен бенчмарков для запуска + context_size: Размер контекста для модели Returns: Список результатов бенчмарков @@ -45,7 +46,7 @@ def run_benchmarks(ollama_client: OllamaClient, model_name: str, benchmarks: Lis logging.info(f"Running {benchmark_name} benchmark...") benchmark = benchmark_classes[benchmark_name]() - result = benchmark.run(ollama_client, model_name) + result = benchmark.run(ollama_client, model_name, context_size) results.append(result) return results diff --git a/src/models/__pycache__/ollama_client.cpython-313.pyc b/src/models/__pycache__/ollama_client.cpython-313.pyc deleted file mode 100644 index 4318c9d..0000000 Binary files a/src/models/__pycache__/ollama_client.cpython-313.pyc and /dev/null differ diff --git a/src/utils/__pycache__/report.cpython-313.pyc b/src/utils/__pycache__/report.cpython-313.pyc deleted file mode 100644 index c6a5895..0000000 Binary files a/src/utils/__pycache__/report.cpython-313.pyc and /dev/null differ diff --git a/src/utils/__pycache__/scoring.cpython-313.pyc b/src/utils/__pycache__/scoring.cpython-313.pyc deleted file mode 100644 index b861ee8..0000000 Binary files a/src/utils/__pycache__/scoring.cpython-313.pyc and /dev/null differ