Skip to content

Commit 1808173

Browse files
committed
chore: fix optimize adapter lint
1 parent ad6efcc commit 1808173

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

trpc_agent_sdk/evaluation/_optimize_gepa_adapter.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
from __future__ import annotations
2626

2727
import asyncio
28+
import os
2829
import tempfile
2930
import uuid
30-
import os
3131
from pathlib import Path
3232
from typing import Any
3333
from typing import Mapping
@@ -611,7 +611,10 @@ def evaluate(
611611
loop = self._get_or_create_loop()
612612
loop.run_until_complete(self.target_prompt.write_all(candidate))
613613

614-
tmp_parent = Path(self.output_dir) / "tmp_batches" if getattr(self, "output_dir", None) else Path.cwd() / "tmp" / "optimizer_batches"
614+
if getattr(self, "output_dir", None):
615+
tmp_parent = Path(self.output_dir) / "tmp_batches"
616+
else:
617+
tmp_parent = Path.cwd() / "tmp" / "optimizer_batches"
615618
tmp_parent.mkdir(parents=True, exist_ok=True)
616619
with tempfile.TemporaryDirectory(dir=tmp_parent) as tmp:
617620
tmp_path = Path(tmp)
@@ -643,8 +646,14 @@ def evaluate(
643646

644647
outcome = loop.run_until_complete(
645648
run_evaluator(
646-
eval_dataset_path=os.path.relpath(evalset_path, Path.cwd()).replace("\\", "/"),
647-
eval_metrics_path=os.path.relpath(metrics_path, Path.cwd()).replace("\\", "/"),
649+
eval_dataset_path=os.path.relpath(
650+
evalset_path,
651+
Path.cwd(),
652+
).replace("\\", "/"),
653+
eval_metrics_path=os.path.relpath(
654+
metrics_path,
655+
Path.cwd(),
656+
).replace("\\", "/"),
648657
call_agent=self.call_agent,
649658
callbacks=self.callbacks,
650659
num_runs=self.num_runs,

0 commit comments

Comments
 (0)