fix(metrics): evaluate_batch still calls the pre-refactor evaluate signatures - #1258
Open
Anai-Guo wants to merge 1 commit into
Open
fix(metrics): evaluate_batch still calls the pre-refactor evaluate signatures#1258Anai-Guo wants to merge 1 commit into
Anai-Guo wants to merge 1 commit into
Conversation
…signatures Both `evaluate_batch` helpers were left behind when their callees were switched to dict inputs, so every batch path raises TypeError. * RatingEval.evaluate_batch calls `self.evaluate(prompt, response, groundtruth)` while `RatingEval.evaluate(self, inputs: dict, predictions: dict)` takes two dicts. SummaryEval.evaluate_batch, right above it in the same file, already calls the two-dict form. * PrometheusEval.evaluate_batch splats entries into three lists and calls `self.evaluate_response(query, result, answer)` while `evaluate_response(self, llm_response: Dict[str, str])` takes one dict. That also silently dropped `response_a`/`response_b`, which `evaluate_response` needs for `relative_grading`. Since the public `PrometheusEval.evaluate()` builds the dicts and delegates to `evaluate_batch`, that entry point is unusable today. Pass the dicts through in both places. `evaluate_response` already reads every key it needs off the entry, so the destructuring is dropped rather than rebuilt.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Two
evaluate_batchhelpers inlangtest/metrics/were never updated when the methods they call were switched to dict-shaped inputs. Both raiseTypeErroron the first iteration.1.
RatingEval.evaluate_batch—langtest/metrics/llm_eval.pySummaryEval.evaluate_batch, ~100 lines above in the same file, is the correct sibling — it already passes the two dicts:2.
PrometheusEval.evaluate_batch—langtest/metrics/prometheus_eval.pyThis one takes out the public entry point too —
PrometheusEval.evaluate()builds the entry dicts and delegates straight toevaluate_batch, soevaluate()cannot return.The destructuring is also lossy:
evaluate_responsereadsresponse_a/response_boff the entry foreval_type == "relative_grading", and those keys were being dropped.Changes
RatingEval.evaluate_batch: build theinputs/predictionsdicts and pass them, matchingSummaryEval.evaluate_batch.include_groundtruthgating is left toevaluate, which already applies it.PrometheusEval.evaluate_batch: forward each entry unchanged —evaluate_responsealready reads every key it needs, includingresponse_a/response_b.Verification
Signatures rebuilt from the repo files with
ast, calls replayed throughinspect.Signature.bind:black==23.3.0 --line-length=90reports both files unchanged, andflake8==6.0.0produces byte-identical findings before and after the patch (all pre-existing, none on the touched lines).🤖 Generated with Claude Code