Romain Fayoux
Started to run evaluations outside of submit loop
3a7aaed
raw
history blame contribute delete
318 Bytes
from phoenix.evals import create_evaluator
@create_evaluator(name="conciseness_evaluator")
def conciseness_evaluator(output: str, expected: str):
ratio = (len(output) / len(expected))
if ratio < 0.5:
return "too short"
elif ratio > 3.0:
return "too long"
else:
return "concise"