Skip to content

Commit ab14874

Browse files
enable together models and reasoning models as judges. (#537)
Co-authored-by: Nathan Habib <[email protected]>
1 parent 8bbe38a commit ab14874

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lighteval/metrics/llm_as_judge.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,18 @@ def __call_api(prompt):
249249
error_message = "ERROR: Failed to get response from the API."
250250
for _ in range(self.API_MAX_RETRY):
251251
try:
252+
max_new_tokens = 512
253+
if "o1" in self.model or "o3" in self.model or "R1" in self.model:
254+
max_new_tokens = min(max_new_tokens * 10, 32000)
255+
252256
kwargs = {
253257
"model": self.model,
254258
"messages": prompt,
255-
"response_format": {"type": "text"},
256-
"max_tokens": 512,
259+
"max_tokens": max_new_tokens,
257260
"n": 1,
258261
"caching": True,
259262
}
263+
260264
response = litellm.completion(**kwargs)
261265
text = response.choices[0].message.content
262266
if not text or text == error_message:

0 commit comments

Comments
 (0)