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

ADD GPT-4 as Judge #206

Merged
merged 4 commits into from
Jul 4, 2024
Merged

ADD GPT-4 as Judge #206

merged 4 commits into from
Jul 4, 2024

Conversation

philschmid
Copy link
Member

No description provided.

@philschmid philschmid requested a review from NathanHB June 20, 2024 13:33
Copy link
Member

@clefourrier clefourrier left a comment

Choose a reason for hiding this comment

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

LGTM, ideally you'd also want to add it in metrics

@philschmid
Copy link
Member Author

ideally you'd also want to add it in metrics

Where?

@clefourrier
Copy link
Member

src/lighteval/metrics/metrics.py, like these 2 atm


    llm_judge_multi_turn_openai = SampleLevelMetricGrouping(
        metric=["single_turn", "multi_turn"],
        higher_is_better=True,
        category=MetricCategory.LLM_AS_JUDGE_MULTI_TURN,
        use_case=MetricUseCase.SUMMARIZATION,
        sample_level_fn=JudgeLLM(
            judge_model_name="gpt-3.5-turbo",
            template_path=os.path.join(os.path.dirname(__file__), "judge_prompts.jsonl"),
            multi_turn=True,
        ).compute,
        corpus_level_fn={
            "single_turn": np.mean,
            "multi_turn": np.mean,
        },
    )
    llm_judge_openai = SampleLevelMetricGrouping(
        metric=["judge_score"],
        higher_is_better=True,
        category=MetricCategory.LLM_AS_JUDGE,
        use_case=MetricUseCase.SUMMARIZATION,
        sample_level_fn=JudgeLLM(
            judge_model_name="gpt-3.5-turbo",
            template_path=os.path.join(os.path.dirname(__file__), "", "judge_prompts.jsonl"),
            multi_turn=False,
        ).compute,
        corpus_level_fn={
            "judge_score": np.mean,
        },
    )

(name might be slightly different)

@clefourrier
Copy link
Member

Basically it allows the judges you defined to be in the general metrics available to users

@clefourrier clefourrier merged commit 0bceaee into main Jul 4, 2024
2 checks passed
hynky1999 pushed a commit to hynky1999/lighteval that referenced this pull request Jul 12, 2024
* ADD GPT-4 as Judge

* Fix style

---------

Co-authored-by: Clémentine Fourrier <[email protected]>
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

2 participants