Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable together models and reasoning models as judges. #537

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/lighteval/metrics/llm_as_judge.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,18 @@ def __call_api(prompt):
error_message = "ERROR: Failed to get response from the API."
for _ in range(self.API_MAX_RETRY):
try:
max_new_tokens = 512
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be set at runtime, I openned a PR to be able to change max_new_tokens in the config file of litellm

if "o1" in self.model or "o3" in self.model or "R1" in self.model:
max_new_tokens = min(max_new_tokens * 10, 32000)

kwargs = {
"model": self.model,
"messages": prompt,
"response_format": {"type": "text"},
"max_tokens": 512,
"max_tokens": max_new_tokens,
"n": 1,
"caching": True,
}

response = litellm.completion(**kwargs)
text = response.choices[0].message.content
if not text or text == error_message:
Expand Down