Skip to content

Commit

Permalink
Fix using OpenAiInferenceEngine for LLMAsJudge (#1194)
Browse files Browse the repository at this point in the history
Signed-off-by: Yifan Mai <yifan@cs.stanford.edu>
Co-authored-by: Elron Bandel <elronbandel@gmail.com>
  • Loading branch information
yifanmai and elronbandel committed Sep 8, 2024
1 parent ba2f04a commit 258d5bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/unitxt/llm_as_judge.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ def verify(self):
)

if isinstance(self.inference_model, OpenAiInferenceEngine):
if self.format:
if self.format and type(self.format) is not SystemFormat:
raise ValueError(
"Error in 'LLMAsJudge' metric. Inference model 'OpenAiInferenceEngine' does "
"not support formatting. Please remove the format definition from the recipe"
" (OpenAi Chat API take care of the formatting automatically)."
)
if self.system_prompt:
if self.system_prompt and type(self.system_prompt) is not EmptySystemPrompt:
raise ValueError(
"Error in 'LLMAsJudge' metric. Inference model 'OpenAiInferenceEngine' does "
"not support system prompt. Please remove the system_prompt definition from the recipe"
Expand Down

0 comments on commit 258d5bf

Please sign in to comment.