Skip to content

Commit

Permalink
fix: rebase errors
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasKoehneckeAA committed May 13, 2024
1 parent 6383ed0 commit b13166a
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions src/intelligence_layer/evaluation/evaluation/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,8 @@ def evaluation_lineage(
output_type=self.output_type(),
evaluation_type=self.evaluation_type(),
)



class Evaluator(EvaluatorBase[Input, Output, ExpectedOutput, Evaluation]):
"""Evaluator designed for most evaluation tasks. Only supports synchronous evaluation.
Expand All @@ -508,7 +509,6 @@ def __init__(
Input, Output, ExpectedOutput, Evaluation
]

@final
def evaluate_runs(
self,
*run_ids: str,
Expand Down Expand Up @@ -605,7 +605,8 @@ def evaluate(
)

return result



class IncrementalEvaluator(Evaluator[Input, Output, ExpectedOutput, Evaluation]):
""":class:`Evaluator` for evaluating additional runs on top of previous evaluations. Intended for use with :class:`IncrementalEvaluationLogic`.
Expand All @@ -629,7 +630,6 @@ def __init__(
run_repository: RunRepository,
evaluation_repository: EvaluationRepository,
description: str,

incremental_evaluation_logic: IncrementalEvaluationLogic[
Input, Output, ExpectedOutput, Evaluation
],
Expand All @@ -641,6 +641,9 @@ def __init__(
description=description,
evaluation_logic=incremental_evaluation_logic,
)
self._evaluation_logic: IncrementalEvaluationLogic[
Input, Output, ExpectedOutput, Evaluation
]

def evaluate_additional_runs(
self,
Expand Down Expand Up @@ -684,10 +687,7 @@ def evaluate_additional_runs(
prev_run_ids.add(output.run_id)
previous_run_ids.append(prev_run_ids)

cast(
IncrementalEvaluationLogic[Input, Output, ExpectedOutput, Evaluation],
self._evaluation_logic,
).set_previous_run_output_ids(previous_run_ids)
self._evaluation_logic.set_previous_run_output_ids(previous_run_ids)
return super().evaluate_runs(
*run_ids, num_examples=num_examples, abort_on_error=abort_on_error
)
Expand All @@ -698,10 +698,7 @@ def evaluate_runs(
num_examples: Optional[int] = None,
abort_on_error: bool = False,
) -> EvaluationOverview:
cast(
IncrementalEvaluationLogic[Input, Output, ExpectedOutput, Evaluation],
self._evaluation_logic,
).set_previous_run_output_ids([])
self._evaluation_logic.set_previous_run_output_ids([])
return super().evaluate_runs(
*run_ids, num_examples=num_examples, abort_on_error=abort_on_error
)

0 comments on commit b13166a

Please sign in to comment.