made docker client local to handlers and lazy

loaded so that we don't have to start docker if we don't want it
This commit is contained in:
Karma Riuk
2025-05-18 08:22:32 +02:00
parent e310383721
commit c8b0557498
2 changed files with 8 additions and 11 deletions

View File

@ -1,5 +1,4 @@
import os
import sys, docker
import sys
from utils.handlers import get_build_handler
from .paths import get_project_path
from sacrebleu import sentence_bleu as bleu
@ -11,8 +10,6 @@ REFERENCE_MAP = Dataset.from_json(
ARCHIVES_ROOT = str(get_project_path('../data/archives'))
DOCKER_CLIENT = docker.from_env()
def evaluate_comments(answers: dict[str, str], percent_cb):
total = len(answers)
@ -57,7 +54,6 @@ def evaluate_refinement(answers: dict[str, dict[str, str]], percent_cb):
build_handler = get_build_handler(
ARCHIVES_ROOT, entry.metadata.archive_name(ArchiveState.MERGED)
)
build_handler.set_client(DOCKER_CLIENT)
current_progress += 1
percent_cb(current_progress / total_number_of_steps * 100)
except Exception as e: