Skip to content

Commit

Permalink
Update evaluators (#157)
Browse files Browse the repository at this point in the history
Update to remove user warning
  • Loading branch information
eyurtsev authored Dec 19, 2023
1 parent c2b7043 commit 74b11de
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions langchain_benchmarks/tool_usage/evaluators.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,17 @@ def compare_outputs(
if "output" in run_outputs and qa_evaluator:
output = run_outputs["output"]
with collect_runs() as cb:
qa_results = qa_evaluator.evaluate_strings(
prediction=output,
reference=example_outputs["reference"],
input=run_inputs["question"],
)
if isinstance(qa_evaluator, QAMathEvaluator):
qa_results = qa_evaluator.evaluate_strings(
prediction=output,
reference=example_outputs["reference"],
)
else:
qa_results = qa_evaluator.evaluate_strings(
prediction=output,
reference=example_outputs["reference"],
input=run_inputs["question"],
)
results.append(
EvaluationResult(
key="correctness",
Expand Down

0 comments on commit 74b11de

Please sign in to comment.