Skip to content

Commit 468eecf

Browse files
committed
remove id gen logic
1 parent f56ad91 commit 468eecf

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

eval_protocol/pytest/evaluation_test.py

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -588,25 +588,25 @@ def _log_eval_error(
588588
# prepare parallel eval helper function
589589
semaphore = asyncio.Semaphore(max_concurrent_evaluations)
590590

591-
async def _execute_eval_with_semaphore(**kwargs):
591+
async def _execute_eval_with_semaphore(**inner_kwargs):
592592
async with semaphore:
593593
# NOTE: we will still evaluate errored rows (give users control over this)
594594
# i.e., they can choose to give EvaluateResult.score = 0 for errored rows in their test_func
595-
if "row" in kwargs:
595+
if "row" in inner_kwargs:
596596
result = await execute_with_params(
597597
test_func,
598-
processed_row=kwargs["row"],
598+
processed_row=inner_kwargs["row"],
599599
evaluation_test_kwargs=kwargs.get("evaluation_test_kwargs") or {},
600600
)
601601
if result is None or not isinstance(result, EvaluationRow):
602602
raise ValueError(
603603
f"Test function {test_func.__name__} did not return an EvaluationRow instance. You must return an EvaluationRow instance from your test function decorated with @evaluation_test."
604604
)
605605
return result
606-
if "rows" in kwargs:
606+
if "rows" in inner_kwargs:
607607
results = await execute_with_params(
608608
test_func,
609-
processed_dataset=kwargs["rows"],
609+
processed_dataset=inner_kwargs["rows"],
610610
evaluation_test_kwargs=kwargs.get("evaluation_test_kwargs") or {},
611611
)
612612
if results is None or not isinstance(results, list):
@@ -805,16 +805,6 @@ async def dual_mode_wrapper(*args, **kwargs):
805805
return await pytest_wrapper(*args, **kwargs)
806806

807807
dual_mode_wrapper._origin_func = test_func
808-
# Generate (stable) evaluator ID from function source code hash
809-
try:
810-
func_source = inspect.getsource(test_func)
811-
parsed = ast.parse(func_source)
812-
normalized_source = ast.unparse(parsed)
813-
clean_source = "".join(normalized_source.split()) + test_func.__name__
814-
func_hash = hashlib.sha256(clean_source.encode("utf-8")).hexdigest()[:12]
815-
dual_mode_wrapper._evaluator_id = f"{test_func.__name__}_{func_hash}"
816-
except (OSError, TypeError, SyntaxError):
817-
pass
818808
dual_mode_wrapper._metainfo = {
819809
"mode": mode,
820810
"max_rollout_concurrency": max_concurrent_rollouts,

0 commit comments

Comments
 (0)