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

adds llm as judge using transformers #223

Merged
merged 23 commits into from
Aug 14, 2024
Merged

Conversation

NathanHB
Copy link
Member

@NathanHB NathanHB commented Jul 11, 2024

  • lazy load of openai and transformers lib
  • able to use openai client to prompt transfrmers models
  • add llama 3.1 405B as llm as a judge in default metrics
  • update doc
  • make sure we are not rate limited
  • add option to use local transformer model as judge

@NathanHB NathanHB marked this pull request as draft July 11, 2024 12:04
src/lighteval/metrics/llm_as_judge.py Outdated Show resolved Hide resolved
src/lighteval/metrics/llm_as_judge.py Outdated Show resolved Hide resolved
src/lighteval/metrics/llm_as_judge.py Outdated Show resolved Hide resolved
src/lighteval/metrics/llm_as_judge.py Show resolved Hide resolved
src/lighteval/metrics/metrics.py Show resolved Hide resolved
src/lighteval/metrics/metrics_sample.py Show resolved Hide resolved
src/lighteval/tasks/extended/mt_bench/main.py Outdated Show resolved Hide resolved
src/lighteval/tasks/lighteval_task.py Show resolved Hide resolved
src/lighteval/utils.py Outdated Show resolved Hide resolved
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, just need to

  • rename the api call function
  • add some docs in the README
  • add some checks on the answers to make sure we are able to filter when model as a judge times out for ex

src/lighteval/metrics/llm_as_judge.py Show resolved Hide resolved
src/lighteval/metrics/llm_as_judge.py Outdated Show resolved Hide resolved
src/lighteval/metrics/llm_as_judge.py Outdated Show resolved Hide resolved
src/lighteval/tasks/requests.py Show resolved Hide resolved
@@ -243,9 +243,24 @@ class Metrics(Enum):
"multi_turn": np.mean,
},
)
llm_judge_openai = SampleLevelMetricGrouping(
llm_judge_multi_turn_llama_3_405b = SampleLevelMetricGrouping(
Copy link
Member

Choose a reason for hiding this comment

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

Don't forget to update the README with the new metrics

@NathanHB NathanHB marked this pull request as ready for review August 14, 2024 09:50
@NathanHB NathanHB merged commit cb32024 into main Aug 14, 2024
2 checks passed
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.

3 participants