From 184a431efabac4331503131d7c93c9a7540f8af4 Mon Sep 17 00:00:00 2001 From: Andrew Truong Date: Tue, 29 Oct 2024 21:54:00 -0400 Subject: [PATCH] has_oldstyle_scorers -> _has_oldstyle_scorers --- weave/flow/eval.py | 4 ++-- weave/scorers/__init__.py | 4 ++-- weave/scorers/base_scorer.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/weave/flow/eval.py b/weave/flow/eval.py index f9de7838015..76d78c0902b 100644 --- a/weave/flow/eval.py +++ b/weave/flow/eval.py @@ -17,9 +17,9 @@ from weave.flow.obj import Object from weave.scorers import ( Scorer, + _has_oldstyle_scorers, auto_summarize, get_scorer_attributes, - has_oldstyle_scorers, transpose, ) from weave.trace.context.weave_client_context import get_weave_client @@ -135,7 +135,7 @@ def model_post_init(self, __context: Any) -> None: scorers.append(scorer) # Determine output key based on scorer types - if has_oldstyle_scorers(scorers): + if _has_oldstyle_scorers(scorers): self._output_key = "model_output" util.warn_once( logger, diff --git a/weave/scorers/__init__.py b/weave/scorers/__init__.py index 01f400f55e0..28583c5ff17 100644 --- a/weave/scorers/__init__.py +++ b/weave/scorers/__init__.py @@ -1,8 +1,8 @@ from weave.scorers.base_scorer import ( Scorer, + _has_oldstyle_scorers, auto_summarize, get_scorer_attributes, - has_oldstyle_scorers, ) from weave.scorers.classification_scorer import ( MultiTaskBinaryClassificationF1, @@ -40,7 +40,7 @@ "ContextRelevancyScorer", "EmbeddingSimilarityScorer", "get_scorer_attributes", - "has_oldstyle_scorers", + "_has_oldstyle_scorers", "HallucinationFreeScorer", "InstructorLLMScorer", "ValidJSONScorer", diff --git a/weave/scorers/base_scorer.py b/weave/scorers/base_scorer.py index cc243b1a0d6..5ffb8c41662 100644 --- a/weave/scorers/base_scorer.py +++ b/weave/scorers/base_scorer.py @@ -110,7 +110,7 @@ def get_scorer_attributes( return (scorer_name, score_fn, summarize_fn) # type: ignore -def has_oldstyle_scorers(scorers: list[Union[Callable, Op, Scorer]]) -> bool: +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 []: _, score_fn, _ = get_scorer_attributes(scorer)