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

Transformers model as Judge #174

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

anilaltuner
Copy link

#153

Transformers library added to llm as judge.

Only need is when the JudgeLLM class called, change judge model with transformers.

Ex.

JudgeLLM(
            judge_model_name="microsoft/Phi-3-mini-128k-instruct",
            template_path="src/lighteval/tasks/extended/mt_bench/judge_prompts.jsonl",
            multi_turn=True,
        )

@clefourrier
Copy link
Member

Hi! Thanks for this PR! Can you fix your PR so that tests are passing?

@anilaltuner
Copy link
Author

Yes, I'll fix on a short time but Run tests gives error for

ERROR tests/test_main.py - huggingface_hub.utils._errors.HfHubHTTPError: 500 Server Error: Internal Server Error for url: https://huggingface.co/api/datasets/gsm8k/paths-info/e53f048856ff4f594e959d75785d2c2d37b678ee (Request ID: Root=1-6630cc27-222f10cf5f5b028e1ffcebcc;677b1d40-c6e5-4fc5-9718-6441f20a365c)

Is it about huggingface hub?

@clefourrier
Copy link
Member

Hm, let me re-run your tests, maybe you committed when the hub was down

@anilaltuner
Copy link
Author

Thanks, I fixed code quality and pushed. We can re-run whenever you want

@clefourrier
Copy link
Member

cc @NathanHB if you have the time to do a more in depth review

self.generation_args = {
"max_new_tokens": 500,
"return_full_text": False,
"temperature": temperature,
Copy link
Member

Choose a reason for hiding this comment

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

temperature is not needed if do_sample is set to False

@@ -625,22 +625,25 @@ class JudgeLLM:

def __init__(self, judge_model_name: str, template_path: str, multi_turn: bool = False):
if judge_model_name not in self.available_models:
raise ValueError(f"{judge_model_name} not in available models for llm as a judge metric")
judge_type = "openai"
Copy link
Member

Choose a reason for hiding this comment

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

this wouldn't work, if we pass in gpt-12 for example, it will set the judge type to openai and continue, only to fail later because gpt-12 does not exist in the openai api

@NathanHB
Copy link
Member

hey ! thanks for the fix, I will have the bandwitdh to test next week and will merge asap :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants