params override

This commit is contained in:
Xi Yan 2024-12-10 17:27:09 -08:00
parent ed33d00eb4
commit 487126a26a

View file

@ -45,10 +45,7 @@ class LlmAsJudgeScoringFn(BaseScoringFn):
# override params if scoring_params is provided # override params if scoring_params is provided
if scoring_params is not None: if scoring_params is not None:
for attr in scoring_params.__dict__: fn_def.params = scoring_params
override_attr = getattr(scoring_params, attr)
if override_attr is not None:
setattr(fn_def.params, attr, override_attr)
assert fn_def.params is not None, f"LLMAsJudgeparams not found for {fn_def}." assert fn_def.params is not None, f"LLMAsJudgeparams not found for {fn_def}."
assert ( assert (