Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtruong committed Oct 30, 2024
1 parent 184a431 commit d57b59c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
6 changes: 0 additions & 6 deletions weave/flow/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,6 @@ def model_post_init(self, __context: Any) -> None:
logger,
"Using 'model_output' key for compatibility with older scorers. Please update scorers to use 'output' parameter.",
)
else:
self._output_key = "output"
util.warn_once(
logger,
"Using 'output' key for model results. Make sure your scorers expect an 'output' parameter.",
)
self.scorers = scorers

if isinstance(self.dataset, list):
Expand Down
5 changes: 2 additions & 3 deletions weave/scorers/base_scorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,13 @@ def get_scorer_attributes(

def _has_oldstyle_scorers(scorers: list[Union[Callable, Op, Scorer]]) -> bool:
"""Check if any scorers use the deprecated 'model_output' parameter."""
for scorer in scorers or []:
for scorer in scorers:
_, score_fn, _ = get_scorer_attributes(scorer)
if is_op(score_fn):
score_fn = as_op(score_fn)
score_signature = score_fn.signature
else:
score_signature = inspect.signature(score_fn)
score_arg_names = list(score_signature.parameters.keys())
if "model_output" in score_arg_names:
if "model_output" in score_signature.parameters:
return True
return False

0 comments on commit d57b59c

Please sign in to comment.