ajuste no contas
This commit is contained in:
@@ -38,4 +38,13 @@ class TimGroundednessJudge(_TimJudge):
|
||||
class TimResponseQualityJudge(_TimJudge):
|
||||
name='tim_response_quality'
|
||||
async def evaluate(self, question, answer, context):
|
||||
return self._result(await self._invoke(build_rqlt_prompt(str(question or ''), str(answer or ''))))
|
||||
out = await self._invoke(build_rqlt_prompt(str(question or ''), str(answer or '')))
|
||||
# RQLT contract is explicitly 0..10. The base normalizer cannot infer
|
||||
# that score=1 means 1/10 (it also supports judges that already emit
|
||||
# 0..1), so normalize this judge at its boundary.
|
||||
try:
|
||||
out = dict(out or {})
|
||||
out['score'] = float(out.get('score', 0)) / 10.0
|
||||
except Exception:
|
||||
out = {**dict(out or {}), 'score': 0.0}
|
||||
return self._result(out)
|
||||
|
||||
Reference in New Issue
Block a user