feat(frontend): add differential evaluation support
Browse files- Dynamic Tasks generation from upstream llm-jp-eval yaml instead of
hardcoded enum, with local metric override for jculture-mcq (set_f1)
- Confirmation modal showing datasets grouped by category before submit
- Differential dataset computation: compare upstream dataset list against
existing parquet scores to determine missing datasets per model config
- Preview/confirm/cancel submission flow replacing single-step submit
- Partial evaluation display: rows with NaN scores are no longer hidden
- Extract upstream yaml fetching into src/upstream.py to avoid circular
imports
- Fix plot functions to handle missing AVG columns gracefully
- Add missing `requests` import in check_validity.py
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- app.py +42 -18
- src/about.py +159 -434
- src/display/utils.py +11 -34
- src/envs.py +7 -0
- src/populate.py +11 -19
- src/submission/check_validity.py +83 -23
- src/submission/submit.py +158 -75
- src/upstream.py +25 -0
- style.css +33 -0
app.py
CHANGED
|
@@ -49,7 +49,7 @@ from src.i18n import (
|
|
| 49 |
SELECT_NONE_BUTTON_LABEL_JA,
|
| 50 |
)
|
| 51 |
from src.populate import get_evaluation_queue_df, get_leaderboard_df
|
| 52 |
-
from src.submission.submit import
|
| 53 |
|
| 54 |
|
| 55 |
def restart_space() -> None:
|
|
@@ -287,13 +287,14 @@ def plot_size_vs_score(df_filtered: pd.DataFrame) -> go.Figure:
|
|
| 287 |
return go.Figure()
|
| 288 |
df = ORIGINAL_DF[ORIGINAL_DF[AutoEvalColumn.row_id.name].isin(df_filtered[AutoEvalColumn.row_id.name])]
|
| 289 |
df = df[df["#Params (B)"] > 0]
|
| 290 |
-
|
|
|
|
| 291 |
df = df.rename(columns={"model_name_for_query": "Model"})
|
| 292 |
df["model_name_without_org_name"] = df["Model"].str.split("/").str[-1]
|
| 293 |
df = pd.melt(
|
| 294 |
df,
|
| 295 |
id_vars=["Model", "model_name_without_org_name", "#Params (B)"],
|
| 296 |
-
value_vars=
|
| 297 |
var_name="Category",
|
| 298 |
value_name="Score",
|
| 299 |
)
|
|
@@ -339,9 +340,10 @@ def plot_average_scores(df_filtered: pd.DataFrame) -> go.Figure:
|
|
| 339 |
if len(ORIGINAL_DF) == 0 or AutoEvalColumn.row_id.name not in ORIGINAL_DF.columns:
|
| 340 |
return go.Figure()
|
| 341 |
df = ORIGINAL_DF[ORIGINAL_DF[AutoEvalColumn.row_id.name].isin(df_filtered[AutoEvalColumn.row_id.name])]
|
| 342 |
-
|
|
|
|
| 343 |
df = df.rename(columns={"model_name_for_query": "Model"})
|
| 344 |
-
df = df.rename(columns=TASK_AVG_NAME_MAP)
|
| 345 |
df = df.set_index("Model")
|
| 346 |
|
| 347 |
fig = go.Figure()
|
|
@@ -664,20 +666,42 @@ with gr.Blocks() as demo_submission:
|
|
| 664 |
|
| 665 |
submit_button = gr.Button("Submit Eval")
|
| 666 |
submission_result = gr.Markdown()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 667 |
submit_button.click(
|
| 668 |
-
fn=
|
| 669 |
-
inputs=
|
| 670 |
-
|
| 671 |
-
|
| 672 |
-
|
| 673 |
-
|
| 674 |
-
|
| 675 |
-
|
| 676 |
-
|
| 677 |
-
|
| 678 |
-
|
| 679 |
-
|
| 680 |
-
|
|
|
|
|
|
|
| 681 |
)
|
| 682 |
|
| 683 |
# Load user info when the page loads
|
|
|
|
| 49 |
SELECT_NONE_BUTTON_LABEL_JA,
|
| 50 |
)
|
| 51 |
from src.populate import get_evaluation_queue_df, get_leaderboard_df
|
| 52 |
+
from src.submission.submit import cancel_eval, confirm_eval, preview_eval
|
| 53 |
|
| 54 |
|
| 55 |
def restart_space() -> None:
|
|
|
|
| 287 |
return go.Figure()
|
| 288 |
df = ORIGINAL_DF[ORIGINAL_DF[AutoEvalColumn.row_id.name].isin(df_filtered[AutoEvalColumn.row_id.name])]
|
| 289 |
df = df[df["#Params (B)"] > 0]
|
| 290 |
+
available_avg = [c for c in AVG_COLUMNS if c in df.columns]
|
| 291 |
+
df = df[["model_name_for_query", "#Params (B)"] + available_avg]
|
| 292 |
df = df.rename(columns={"model_name_for_query": "Model"})
|
| 293 |
df["model_name_without_org_name"] = df["Model"].str.split("/").str[-1]
|
| 294 |
df = pd.melt(
|
| 295 |
df,
|
| 296 |
id_vars=["Model", "model_name_without_org_name", "#Params (B)"],
|
| 297 |
+
value_vars=available_avg,
|
| 298 |
var_name="Category",
|
| 299 |
value_name="Score",
|
| 300 |
)
|
|
|
|
| 340 |
if len(ORIGINAL_DF) == 0 or AutoEvalColumn.row_id.name not in ORIGINAL_DF.columns:
|
| 341 |
return go.Figure()
|
| 342 |
df = ORIGINAL_DF[ORIGINAL_DF[AutoEvalColumn.row_id.name].isin(df_filtered[AutoEvalColumn.row_id.name])]
|
| 343 |
+
available_avg_keys = [k for k in TASK_AVG_NAME_MAP if k in df.columns]
|
| 344 |
+
df = df[["model_name_for_query"] + available_avg_keys]
|
| 345 |
df = df.rename(columns={"model_name_for_query": "Model"})
|
| 346 |
+
df = df.rename(columns={k: TASK_AVG_NAME_MAP[k] for k in available_avg_keys})
|
| 347 |
df = df.set_index("Model")
|
| 348 |
|
| 349 |
fig = go.Figure()
|
|
|
|
| 666 |
|
| 667 |
submit_button = gr.Button("Submit Eval")
|
| 668 |
submission_result = gr.Markdown()
|
| 669 |
+
eval_entry_state = gr.State(value=None)
|
| 670 |
+
|
| 671 |
+
with gr.Column(visible=False, elem_classes="confirm-modal-overlay") as modal_overlay:
|
| 672 |
+
with gr.Column(elem_classes="confirm-modal-box"):
|
| 673 |
+
modal_content = gr.Markdown()
|
| 674 |
+
with gr.Row():
|
| 675 |
+
confirm_button = gr.Button("Confirm", variant="primary", scale=1)
|
| 676 |
+
cancel_button = gr.Button("Cancel", variant="secondary", scale=1)
|
| 677 |
+
|
| 678 |
+
submit_inputs = [
|
| 679 |
+
model_name_textbox,
|
| 680 |
+
revision_name_textbox,
|
| 681 |
+
precision,
|
| 682 |
+
model_type,
|
| 683 |
+
add_special_tokens,
|
| 684 |
+
apply_chat_template,
|
| 685 |
+
enable_thinking,
|
| 686 |
+
reasoning_parser,
|
| 687 |
+
]
|
| 688 |
+
|
| 689 |
submit_button.click(
|
| 690 |
+
fn=preview_eval,
|
| 691 |
+
inputs=submit_inputs,
|
| 692 |
+
outputs=[submission_result, modal_content, modal_overlay, eval_entry_state],
|
| 693 |
+
api_name="preview_eval",
|
| 694 |
+
)
|
| 695 |
+
confirm_button.click(
|
| 696 |
+
fn=confirm_eval,
|
| 697 |
+
inputs=[eval_entry_state],
|
| 698 |
+
outputs=[submission_result, modal_overlay, eval_entry_state],
|
| 699 |
+
api_name="confirm_eval",
|
| 700 |
+
)
|
| 701 |
+
cancel_button.click(
|
| 702 |
+
fn=cancel_eval,
|
| 703 |
+
inputs=[],
|
| 704 |
+
outputs=[submission_result, modal_overlay, eval_entry_state],
|
| 705 |
)
|
| 706 |
|
| 707 |
# Load user info when the page loads
|
src/about.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
| 1 |
from dataclasses import dataclass
|
| 2 |
from enum import Enum
|
| 3 |
|
|
|
|
|
|
|
| 4 |
|
| 5 |
class TaskType(Enum):
|
| 6 |
AVG = "Average - 平均"
|
|
@@ -12,16 +14,103 @@ class TaskType(Enum):
|
|
| 12 |
FA = "FA - 基礎分析"
|
| 13 |
MR = "MR - 数学的推論"
|
| 14 |
MT = "MT - 機械翻訳"
|
| 15 |
-
STS = "STS - 意味的類似度"
|
| 16 |
HE_EN = "HE-EN - 英語試験問題"
|
| 17 |
HE_JA = "HE-JA - 日本語試験問題"
|
| 18 |
CG = "CG - コード生成"
|
| 19 |
SUM = "SUM - 要約"
|
| 20 |
BBH = "BBH - Big-Bench Hard"
|
| 21 |
IF = "IF - 指示追従"
|
|
|
|
| 22 |
NotTask = "?"
|
| 23 |
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
@dataclass
|
| 26 |
class Task:
|
| 27 |
benchmark: str
|
|
@@ -31,136 +120,43 @@ class Task:
|
|
| 31 |
average: bool = False
|
| 32 |
|
| 33 |
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
jsick_exact_match = Task("scores", "jsick_exact_match", "JSICK ⭐", TaskType.NLI)
|
| 70 |
-
jsquad_char_f1 = Task("scores", "jsquad_char_f1", "JSquad ⭐", TaskType.RC)
|
| 71 |
-
jsts_pearson = Task(
|
| 72 |
-
"scores", "jsts_pearson", "JSTS (Pearson)", TaskType.STS
|
| 73 |
-
) # Semantic Textual Similarity - 意味的類似度
|
| 74 |
-
jsts_spearman = Task(
|
| 75 |
-
"scores", "jsts_spearman", "JSTS (Spearman)", TaskType.STS
|
| 76 |
-
) # Semantic Textual Similarity - 意味的類似度
|
| 77 |
-
kuci_exact_match = Task("scores", "kuci_exact_match", "KUCI ⭐", TaskType.CR)
|
| 78 |
-
mawps_mathematical_equivalence = Task("scores", "mawps_mathematical_equivalence", "MAWPS ⭐", TaskType.MR)
|
| 79 |
-
mbpp_code_exec_sandbox = Task("scores", "mbpp_code_exec_sandbox", "MBPP (exec) (0 shots only) ⭐", TaskType.CG)
|
| 80 |
-
mbpp_pylint_check = Task("scores", "mbpp_pylint_check", "MBPP (pylint) (0 shots only)", TaskType.CG)
|
| 81 |
-
mmlu_en_exact_match = Task("scores", "mmlu_en_exact_match", "MMLU ⭐", TaskType.HE_EN)
|
| 82 |
-
niilc_char_f1 = Task("scores", "niilc_char_f1", "NIILC ⭐", TaskType.QA)
|
| 83 |
-
aio_char_f1 = Task("scores", "aio_char_f1", "JAQKET ⭐", TaskType.QA)
|
| 84 |
-
wiki_coreference_set_f1 = Task("scores", "wiki_coreference_set_f1", "Wiki Coreference ⭐", TaskType.FA)
|
| 85 |
-
wiki_dependency_set_f1 = Task("scores", "wiki_dependency_set_f1", "Wiki Dependency ⭐", TaskType.FA)
|
| 86 |
-
wiki_ner_set_f1 = Task("scores", "wiki_ner_set_f1", "Wiki NER ⭐", TaskType.FA)
|
| 87 |
-
wiki_pas_set_f1 = Task("scores", "wiki_pas_set_f1", "Wiki PAS ⭐", TaskType.FA)
|
| 88 |
-
wiki_reading_char_f1 = Task("scores", "wiki_reading_char_f1", "Wiki Reading ⭐", TaskType.FA)
|
| 89 |
-
wikicorpus_e_to_j_bert_score_ja_f1 = Task(
|
| 90 |
-
"scores", "wikicorpus-e-to-j_bert_score_ja_f1", "WikiCorpus E to J BERT Score", TaskType.MT
|
| 91 |
-
)
|
| 92 |
-
wikicorpus_e_to_j_bleu_ja = Task("scores", "wikicorpus-e-to-j_bleu_ja", "WikiCorpus E to J BLEU", TaskType.MT)
|
| 93 |
-
wikicorpus_e_to_j_comet_wmt22 = Task(
|
| 94 |
-
"scores", "wikicorpus-e-to-j_comet_wmt22", "WikiCorpus E to J COMET WMT22 ⭐", TaskType.MT
|
| 95 |
-
)
|
| 96 |
-
wikicorpus_j_to_e_bert_score_en_f1 = Task(
|
| 97 |
-
"scores", "wikicorpus-j-to-e_bert_score_en_f1", "WikiCorpus J to E BERT Score", TaskType.MT
|
| 98 |
-
)
|
| 99 |
-
wikicorpus_j_to_e_bleu_en = Task("scores", "wikicorpus-j-to-e_bleu_en", "WikiCorpus J to E BLEU", TaskType.MT)
|
| 100 |
-
wikicorpus_j_to_e_comet_wmt22 = Task(
|
| 101 |
-
"scores", "wikicorpus-j-to-e_comet_wmt22", "WikiCorpus J to E COMET WMT22 ⭐", TaskType.MT
|
| 102 |
-
)
|
| 103 |
-
xlsum_ja_bert_score_ja_f1 = Task(
|
| 104 |
-
"scores", "xlsum_ja_bert_score_ja_f1", "XL-Sum JA BERT Score (0 shots only)", TaskType.SUM
|
| 105 |
-
)
|
| 106 |
-
xlsum_ja_bleu_ja = Task("scores", "xlsum_ja_bleu_ja", "XL-Sum JA BLEU (0 shots only)", TaskType.SUM)
|
| 107 |
-
xlsum_ja_rouge1 = Task("scores", "xlsum_ja_rouge1", "XL-Sum ROUGE1 (0 shots only)", TaskType.SUM)
|
| 108 |
-
xlsum_ja_rouge2 = Task("scores", "xlsum_ja_rouge2", "XL-Sum ROUGE2 (0 shots only) ⭐", TaskType.SUM)
|
| 109 |
-
# xlsum_ja_rouge2_scaling = Task("scores", "xlsum_ja_rouge2_scaling", "XL-Sum JA ROUGE2 Scaling")
|
| 110 |
-
xlsum_ja_rouge_lsum = Task("scores", "xlsum_ja_rougeLsum", "XL-Sum ROUGE-Lsum (0 shots only)", TaskType.SUM)
|
| 111 |
-
# New tasks for v2.0.0
|
| 112 |
-
aime2024_mathematical_equivalence = Task(
|
| 113 |
-
"scores", "aime2024_mathematical_equivalence", "AIME 2024 ⭐", TaskType.MR
|
| 114 |
-
)
|
| 115 |
-
aime2025_mathematical_equivalence = Task(
|
| 116 |
-
"scores", "aime2025_mathematical_equivalence", "AIME 2025 ⭐", TaskType.MR
|
| 117 |
-
)
|
| 118 |
-
bigbenchhard_direct_exact_match = Task("scores", "bigbenchhard_direct_exact_match", "BBH Direct ⭐", TaskType.BBH)
|
| 119 |
-
bigbenchhard_cot_exact_match = Task("scores", "bigbenchhard_cot_exact_match", "BBH CoT ⭐", TaskType.BBH)
|
| 120 |
-
bigbenchhard_ja_direct_exact_match = Task(
|
| 121 |
-
"scores", "bigbenchhard_ja_direct_exact_match", "BBH JA Direct ⭐", TaskType.BBH
|
| 122 |
-
)
|
| 123 |
-
bigbenchhard_ja_cot_exact_match = Task("scores", "bigbenchhard_ja_cot_exact_match", "BBH JA CoT ⭐", TaskType.BBH)
|
| 124 |
-
drop_drop_f1 = Task("scores", "drop_drop_f1", "DROP ⭐", TaskType.QA)
|
| 125 |
-
gsm8k_mathematical_equivalence = Task("scores", "gsm8k_mathematical_equivalence", "GSM8K ⭐", TaskType.MR)
|
| 126 |
-
gpqa_diamond_en_exact_match = Task("scores", "gpqa_diamond_en_exact_match", "GPQA Diamond EN ⭐", TaskType.HE_EN)
|
| 127 |
-
gpqa_extended_en_exact_match = Task(
|
| 128 |
-
"scores", "gpqa_extended_en_exact_match", "GPQA Extended EN ⭐", TaskType.HE_EN
|
| 129 |
-
)
|
| 130 |
-
gpqa_main_en_exact_match = Task("scores", "gpqa_main_en_exact_match", "GPQA Main EN ⭐", TaskType.HE_EN)
|
| 131 |
-
gpqa_diamond_ja_exact_match = Task("scores", "gpqa_diamond_ja_exact_match", "GPQA Diamond JA ⭐", TaskType.HE_JA)
|
| 132 |
-
gpqa_extended_ja_exact_match = Task(
|
| 133 |
-
"scores", "gpqa_extended_ja_exact_match", "GPQA Extended JA ⭐", TaskType.HE_JA
|
| 134 |
-
)
|
| 135 |
-
gpqa_main_ja_exact_match = Task("scores", "gpqa_main_ja_exact_match", "GPQA Main JA ⭐", TaskType.HE_JA)
|
| 136 |
-
jamc_qa_exact_match = Task("scores", "jamc-qa_exact_match", "JAMC-QA ⭐", TaskType.QA)
|
| 137 |
-
jhumaneval_code_exec_sandbox = Task("scores", "jhumaneval_code_exec_sandbox", "JHumanEval ⭐", TaskType.CG)
|
| 138 |
-
mgsm_mathematical_equivalence = Task("scores", "mgsm_mathematical_equivalence", "MGSM ⭐", TaskType.MR)
|
| 139 |
-
mmlu_prox_ja_exact_match = Task("scores", "mmlu_prox_ja_exact_match", "MMLU Prox JA ⭐", TaskType.HE_JA)
|
| 140 |
-
mmlu_prox_en_exact_match = Task("scores", "mmlu_prox_en_exact_match", "MMLU Prox EN ⭐", TaskType.HE_EN)
|
| 141 |
-
mif_eval_ja_mifeval_strict = Task("scores", "mif_eval_ja_mifeval_strict", "MIF Eval JA ⭐", TaskType.IF)
|
| 142 |
-
mif_eval_en_mifeval_strict = Task("scores", "mif_eval_en_mifeval_strict", "MIF Eval EN ⭐", TaskType.IF)
|
| 143 |
-
mmmlu_exact_match = Task("scores", "mmmlu_exact_match", "MMMLU ⭐", TaskType.HE_JA)
|
| 144 |
-
openbookqa_exact_match = Task("scores", "openbookqa_exact_match", "OpenBookQA ⭐", TaskType.HE_EN)
|
| 145 |
-
polymath_en_polymath_weighted_accuracy = Task(
|
| 146 |
-
"scores", "polymath-en_polymath_weighted_accuracy", "Polymath EN ⭐", TaskType.MR
|
| 147 |
-
)
|
| 148 |
-
polymath_ja_polymath_weighted_accuracy = Task(
|
| 149 |
-
"scores", "polymath-ja_polymath_weighted_accuracy", "Polymath JA ⭐", TaskType.MR
|
| 150 |
-
)
|
| 151 |
-
triviaqa_triviaqa_f1 = Task("scores", "triviaqa_triviaqa_f1", "TriviaQA ⭐", TaskType.QA)
|
| 152 |
-
winogrande_xl_exact_match = Task("scores", "winogrande_xl_exact_match", "WinoGrande XL ⭐", TaskType.CR)
|
| 153 |
-
# HLE/JHLE - Humanity's Last Exam
|
| 154 |
-
hle_hle_exact_match = Task("scores", "hle_hle_exact_match", "HLE ⭐", TaskType.HE_EN)
|
| 155 |
-
jhle_hle_exact_match = Task("scores", "jhle_hle_exact_match", "JHLE ⭐", TaskType.HE_JA)
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
# ---------------------------------------------------
|
| 159 |
-
|
| 160 |
-
# Your leaderboard name
|
| 161 |
TITLE = """<h1 align="center" id="space-title">🇯🇵 Open Japanese LLM Leaderboard V2 🌸<br>オープン日本語LLMリーダーボード V2</h1>"""
|
| 162 |
|
| 163 |
-
# What does your leaderboard evaluate?
|
| 164 |
INTRODUCTION_TEXT = """
|
| 165 |
The __Open Japanese LLM Leaderboard__ by __[LLM-jp](https://llm-jp.nii.ac.jp/en/)__ evaluates
|
| 166 |
the performance of Japanese Large Language Models (LLMs) across 14 categories covering more than 71 tasks from
|
|
@@ -189,344 +185,73 @@ __「LLM Benchmark」__ ページでは、疑問符 **「?」** はHugging Face
|
|
| 189 |
参加することができます。
|
| 190 |
"""
|
| 191 |
|
| 192 |
-
# Which evaluations are you running? how can people reproduce what you have?
|
| 193 |
LLM_BENCHMARKS_TEXT = """
|
| 194 |
## How it works
|
| 195 |
📈 We evaluate Japanese Large Language Models across 14 categories covering more than 71 tasks leveraging our evaluation tool [llm-jp-eval](https://github.com/llm-jp/llm-jp-eval), a unified framework to evaluate Japanese LLMs on various evaluation tasks.
|
| 196 |
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
* `Jamp`, a Japanese NLI benchmark focused on temporal inference [Source](https://github.com/tomo-ut/temporalNLI_dataset) (License CC BY-SA 4.0)
|
| 200 |
-
|
| 201 |
-
* `JaNLI`, Japanese Adversarial Natural Language Inference [Source](https://github.com/verypluming/JaNLI) (License CC BY-SA 4.0)
|
| 202 |
-
|
| 203 |
-
* `JNLI`, Japanese Natural Language Inference (part of JGLUE) [Source](https://github.com/yahoojapan/JGLUE) (License CC BY-SA 4.0)
|
| 204 |
-
|
| 205 |
-
* `JSeM`, Japanese semantic test suite [Source](https://github.com/DaisukeBekki/JSeM) (License BSD 3-Clause)
|
| 206 |
-
|
| 207 |
-
* `JSICK`, Japanese Sentences Involving Compositional Knowledge [Source](https://github.com/verypluming/JSICK) (License CC BY-SA 4.0)
|
| 208 |
-
|
| 209 |
-
**QA (Question Answering)**
|
| 210 |
-
|
| 211 |
-
* `JEMHopQA`, Japanese Explainable Multi-hop Question Answering [Source](https://github.com/aiishii/JEMHopQA) (License CC BY-SA 4.0)
|
| 212 |
-
|
| 213 |
-
* `NIILC`, NIILC Question Answering Dataset [Source](https://github.com/mynlp/niilc-qa) (License CC BY-SA 4.0)
|
| 214 |
-
|
| 215 |
-
* `JAQKET`, Japanese QA dataset on the subject of quizzes [Source](https://www.nlp.ecei.tohoku.ac.jp/projects/jaqket/) (License CC BY-SA 4.0 - Other licenses are required for corporate usage)
|
| 216 |
-
|
| 217 |
-
* `TriviaQA`, Reading Comprehension Challenge Dataset [Source](https://nlp.cs.washington.edu/triviaqa/) (License Apache-2.0)
|
| 218 |
-
|
| 219 |
-
* `DROP`, Discrete Reasoning Over Paragraphs [Source](https://allennlp.org/drop) (License CC BY-SA 4.0)
|
| 220 |
-
|
| 221 |
-
* `JAMC-QA`, Japanese Advanced Medical Comprehension Question Answering [Source](https://huggingface.co/datasets/llm-jp/jamc-qa) (License CC BY-SA 4.0)
|
| 222 |
-
|
| 223 |
-
**RC (Reading Comprehension)**
|
| 224 |
-
|
| 225 |
-
* `JSQuAD`, Japanese version of SQuAD (part of JGLUE) [Source](https://github.com/yahoojapan/JGLUE) (License CC BY-SA 4.0)
|
| 226 |
-
|
| 227 |
-
**CR (Commonsense Reasoning)**
|
| 228 |
-
|
| 229 |
-
* `JCommonsenseMorality`, Japanese dataset for evaluating commonsense morality understanding [Source](https://github.com/Language-Media-Lab/commonsense-moral-ja) (License MIT License)
|
| 230 |
-
|
| 231 |
-
* `JCommonsenseQA`, Japanese version of CommonsenseQA [Source](https://github.com/yahoojapan/JGLUE) (License CC BY-SA 4.0)
|
| 232 |
-
|
| 233 |
-
* `KUCI`, Kyoto University Commonsense Inference dataset [Source](https://github.com/ku-nlp/KUCI (License CC BY-SA 4.0)
|
| 234 |
-
|
| 235 |
-
* `WinoGrande`, Winogrande Pronoun Disambiguation [Source](https://huggingface.co/datasets/winogrande) (License Apache-2.0)
|
| 236 |
-
|
| 237 |
-
**EL (Entity Linking)**
|
| 238 |
-
|
| 239 |
-
* `chABSA`, Aspect-Based Sentiment Analysis dataset [Source](https://github.com/chakki-works/chABSA-dataset) (License CC BY-SA 4.0)
|
| 240 |
-
|
| 241 |
-
**FA (Fundamental Analysis)**
|
| 242 |
-
|
| 243 |
-
* `Wikipedia Annotated Corpus`, [Source](https://github.com/ku-nlp/WikipediaAnnotatedCorpus) (License CC BY-SA 4.0)
|
| 244 |
-
|
| 245 |
-
List of tasks: (Reading Prediction, Named-entity recognition (NER), Dependency Parsing, Predicate-argument structure analysis (PAS), Coreference Resolution)
|
| 246 |
-
|
| 247 |
-
**MR (Mathematical Reasoning)**
|
| 248 |
-
|
| 249 |
-
* `MAWPS`, Japanese version of MAWPS (A Math Word Problem Repository) [Source](https://github.com/nlp-waseda/chain-of-thought-ja-dataset) (License Apache-2.0)
|
| 250 |
-
|
| 251 |
-
* `MGSM`, Japanese part of MGSM (Multilingual Grade School Math Benchmark) [Source](https://huggingface.co/datasets/juletxara/mgsm) (License MIT License)
|
| 252 |
-
|
| 253 |
-
* `GSM8K`, Grade School Math 8K [Source](https://github.com/openai/grade-school-math) (License MIT License)
|
| 254 |
-
|
| 255 |
-
* `AIME`, American Invitational Mathematics Examination [Source](https://artofproblemsolving.com/wiki/index.php/AIME_Problems_and_Solutions) (License Public Domain)
|
| 256 |
-
|
| 257 |
-
* `Polymath`, Multilevel Multimodal Mathematical Reasoning [Source](https://arxiv.org/abs/2407.21046) (License MIT License)
|
| 258 |
-
|
| 259 |
-
**MT (Machine Translation)**
|
| 260 |
-
|
| 261 |
-
* `ALT`, Asian Language Treebank (ALT) - Parallel Corpus [Source](https://www2.nict.go.jp/astrec-att/member/mutiyama/ALT/index.html) (License CC BY-SA 4.0)
|
| 262 |
-
|
| 263 |
-
* `WikiCorpus`, Japanese-English Bilingual Corpus of Wikipedia's articles about the city of Kyoto [Source](https://alaginrc.nict.go.jp/WikiCorpus/) (License CC BY-SA 3.0)
|
| 264 |
-
|
| 265 |
-
**STS (Semantic Textual Similarity)**
|
| 266 |
-
|
| 267 |
-
This task is supported by llm-jp-eval, but it is not included in the evaluation score average.
|
| 268 |
-
|
| 269 |
-
* `JSTS`, Japanese version of the STS (Semantic Textual Similarity) (part of JGLUE) [Source](https://github.com/yahoojapan/JGLUE) (License CC BY-SA 4.0)
|
| 270 |
-
|
| 271 |
-
**HE-EN (Human Examination - English)**
|
| 272 |
-
|
| 273 |
-
* `MMLU`, Measuring Massive Multitask Language Understanding [Source](https://github.com/hendrycks/test) (License MIT License)
|
| 274 |
-
|
| 275 |
-
* `GPQA`, Graduate-Level Google-Proof Q&A Benchmark [Source](https://github.com/idavidrein/gpqa) (License MIT License)
|
| 276 |
-
|
| 277 |
-
* `OpenBookQA`, Open Book Question Answering [Source](https://allenai.org/data/open-book-qa) (License Apache-2.0)
|
| 278 |
-
|
| 279 |
-
* `HLE`, Humanity's Last Exam [Source](https://huggingface.co/datasets/cais/hle) (License MIT License)
|
| 280 |
-
|
| 281 |
-
**HE-JA (Human Examination - Japanese)**
|
| 282 |
-
|
| 283 |
-
* `JMMLU`, Japanese Massive Multitask Language Understanding Benchmark [Source](https://github.com/nlp-waseda/JMMLU) (License CC BY-SA 4.0 (3 tasks under the CC BY-NC-ND 4.0 license)
|
| 284 |
-
|
| 285 |
-
* `MMMLU`, Japanese version of MMLU [Source](https://huggingface.co/datasets/pfnet/mmmlu) (License MIT License)
|
| 286 |
-
|
| 287 |
-
* `GPQA (JA)`, Japanese translation of GPQA [Source](https://github.com/idavidrein/gpqa) (License MIT License)
|
| 288 |
-
|
| 289 |
-
* `JHLE`, Japanese Humanity's Last Exam [Source](https://huggingface.co/datasets/llm-jp/jhle) (License MIT License)
|
| 290 |
-
|
| 291 |
-
**CG (Code Generation)**
|
| 292 |
-
|
| 293 |
-
* `MBPP`, Japanese version of Mostly Basic Python Problems (MBPP) [Source](https://huggingface.co/datasets/llm-jp/mbpp-ja) (License CC BY-SA 4.0)
|
| 294 |
-
|
| 295 |
-
* `JHumanEval`, Japanese version of HumanEval [Source](https://huggingface.co/datasets/kogi-jwu/jhumaneval) (License MIT License)
|
| 296 |
-
|
| 297 |
-
**BBH (BIG-Bench Hard)**
|
| 298 |
-
|
| 299 |
-
* `BigBenchHard`, Challenging BIG-Bench tasks with chain-of-thought evaluation [Source](https://github.com/suzgunmirac/BIG-Bench-Hard) (License MIT License)
|
| 300 |
-
|
| 301 |
-
**IF (Instruction Following)**
|
| 302 |
-
|
| 303 |
-
* `MIF-Eval`, Multilingual Instruction Following Evaluation [Source](https://huggingface.co/datasets/google/MIF-Eval) (License Apache-2.0)
|
| 304 |
-
|
| 305 |
-
**SUM (Summarization)**
|
| 306 |
-
|
| 307 |
-
* `XL-Sum`, XL-Sum: Large-Scale Multilingual Abstractive Summarization for 44 Languages [Source](https://github.com/csebuetnlp/xl-sum) (License CC BY-NC-SA 4.0, due to the non-commercial license, this dataset will not be used, unless you specifically agree to the license and terms of use)
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
## Reproducibility
|
| 311 |
-
To reproduce our results, please follow the instructions of the evalution tool, **llm-jp-eval** available in [Japanese](https://github.com/llm-jp/llm-jp-eval/blob/main/README.md) and in [English](https://github.com/llm-jp/llm-jp-eval/blob/main/README_en.md).
|
| 312 |
-
|
| 313 |
-
## Average Score Calculation
|
| 314 |
-
The calculation of the average score (AVG) includes only the scores of datasets marked with a ⭐.
|
| 315 |
-
|
| 316 |
-
## Dataset Details
|
| 317 |
-
For comprehensive information about all datasets used in this leaderboard, including detailed descriptions, data sources, preprocessing methods, and the jaster training dataset, please refer to [DATASET.md](https://github.com/llm-jp/llm-jp-eval/blob/main/DATASET.md) in the llm-jp-eval repository.
|
| 318 |
-
|
| 319 |
"""
|
| 320 |
|
| 321 |
LLM_BENCHMARKS_TEXT_JA = """
|
| 322 |
## 仕組み
|
| 323 |
-
📈 評価ツール [llm-jp-eval](https://github.com/llm-jp/llm-jp-eval) を活用し、
|
| 324 |
-
|
| 325 |
-
**NLI(自然言語推論)**
|
| 326 |
-
|
| 327 |
-
* `Jamp`、時間推論に焦点を当てた日本語NLIベンチマーク [ソース](https://github.com/tomo-ut/temporalNLI_dataset)(ライセンス CC BY-SA 4.0)
|
| 328 |
-
|
| 329 |
-
* `JaNLI`、日本語の敵対的推論データセット [ソース](https://github.com/verypluming/JaNLI)(ライセンス CC BY-SA 4.0)
|
| 330 |
-
|
| 331 |
-
* `JNLI`、日本語自然言語推論(JGLUEの一部)[ソース](https://github.com/yahoojapan/JGLUE)(ライセンス CC BY-SA 4.0)
|
| 332 |
-
|
| 333 |
-
* `JSeM`、日本語意味論テストセット [ソース](https://github.com/DaisukeBekki/JSeM)(ライセンス BSD 3-Clause)
|
| 334 |
-
|
| 335 |
-
* `JSICK`、構成的知識を含む日本語文データセット [ソース](https://github.com/verypluming/JSICK)(ライセンス CC BY-SA 4.0)
|
| 336 |
-
|
| 337 |
-
**QA(質問応答)**
|
| 338 |
-
|
| 339 |
-
* `JEMHopQA`、日本語の説明可能なマルチホップ質問応答 [ソース](https://github.com/aiishii/JEMHopQA)(ライセンス CC BY-SA 4.0)
|
| 340 |
-
|
| 341 |
-
* `NIILC`、NIILC質問応答データセット [ソース](https://github.com/mynlp/niilc-qa)(ライセンス CC BY-SA 4.0)
|
| 342 |
-
|
| 343 |
-
* `JAQKET`、クイズを題材とした日本語QAデータセット [ソース](https://www.nlp.ecei.tohoku.ac.jp/projects/jaqket/)(ライセンス CC BY-SA 4.0 - 企業利用には別途ライセンスが必要)
|
| 344 |
-
|
| 345 |
-
**RC(読解)**
|
| 346 |
-
|
| 347 |
-
* `JSQuAD`、SQuADの日本語版(JGLUEの一部)[ソース](https://github.com/yahoojapan/JGLUE)(ライセンス CC BY-SA 4.0)
|
| 348 |
-
|
| 349 |
-
**MC(選択式質問応答)**
|
| 350 |
-
|
| 351 |
-
* `JCommonsenseMorality`、常識的な道徳理解を評価する日本語データセット [ソース](https://github.com/Language-Media-Lab/commonsense-moral-ja)(ライセンス MIT License)
|
| 352 |
-
|
| 353 |
-
* `JCommonsenseQA`、CommonsenseQAの日本語版 [ソース](https://github.com/yahoojapan/JGLUE)(ライセンス CC BY-SA 4.0)
|
| 354 |
-
|
| 355 |
-
* `KUCI`、京都大学常識推論データセット [ソース](https://github.com/ku-nlp/KUCI)(ライセンス CC BY-SA 4.0)
|
| 356 |
-
|
| 357 |
-
**EL(エンティティリンキング)**
|
| 358 |
-
|
| 359 |
-
* `chABSA`、アスペクトベースの感情分析データセット [ソース](https://github.com/chakki-works/chABSA-dataset)(ライセンス CC BY-SA 4.0)
|
| 360 |
-
|
| 361 |
-
**FA(基礎解析)**
|
| 362 |
-
|
| 363 |
-
* `Wikipedia Annotated Corpus`、[ソース](https://github.com/ku-nlp/WikipediaAnnotatedCorpus)(ライセンス CC BY-SA 4.0)
|
| 364 |
-
|
| 365 |
-
タスク一覧:(読解予測、固有表現認識(NER)、依存構造解析、述語項構造解析(PAS)、共参照解析)
|
| 366 |
-
|
| 367 |
-
**MR(数学的推論)**
|
| 368 |
-
|
| 369 |
-
* `MAWPS`、MAWPS(A Math Word Problem Repository)の日本語版 [ソース](https://github.com/nlp-waseda/chain-of-thought-ja-dataset)(ライセンス Apache-2.0)
|
| 370 |
-
|
| 371 |
-
* `MGSM`、MGSM(Multilingual Grade School Math Benchmark)の日本語部分 [ソース](https://huggingface.co/datasets/juletxara/mgsm)(ライセンス MIT License)
|
| 372 |
-
|
| 373 |
-
**MT(機械翻訳)**
|
| 374 |
-
|
| 375 |
-
* `ALT`、アジア言語ツリーバンク(ALT) - 並行コーパス [ソース](https://www2.nict.go.jp/astrec-att/member/mutiyama/ALT/index.html)(ライセンス CC BY-SA 4.0)
|
| 376 |
-
|
| 377 |
-
* `WikiCorpus`、京都市に関するWikipedia記事の日本語-英語対訳コーパス [ソース](https://alaginrc.nict.go.jp/WikiCorpus/)(ライセンス CC BY-SA 3.0)
|
| 378 |
-
|
| 379 |
-
**STS(意味的テキスト類似度)**
|
| 380 |
-
|
| 381 |
-
このタスクはllm-jp-evalでサポートされていますが、平均スコア (AVG) の計算には含まれていません。
|
| 382 |
-
|
| 383 |
-
* `JSTS`、STS(Semantic Textual Similarity)の日本語版(JGLUEの一部)[ソース](https://github.com/yahoojapan/JGLUE)(ライセンス CC BY-SA 4.0)
|
| 384 |
-
|
| 385 |
-
**HE(試験問題)**
|
| 386 |
-
|
| 387 |
-
* `MMLU`、大規模マルチタスク言語理解ベンチマーク(英語) [ソース](https://github.com/hendrycks/test)(ライセンス MIT License)
|
| 388 |
-
|
| 389 |
-
* `JMMLU`、日本語大規模マルチタスク言語理解ベンチマーク [ソース](https://github.com/nlp-waseda/JMMLU)(ライセンス CC BY-SA 4.0(3つのタスクはCC BY-NC-ND 4.0ライセンス)
|
| 390 |
-
|
| 391 |
-
* `HLE`、Humanity's Last Exam(英語) [ソース](https://huggingface.co/datasets/cais/hle)(ライセンス MIT License)
|
| 392 |
-
|
| 393 |
-
* `JHLE`、Humanity's Last Exam(日本語) [ソース](https://huggingface.co/datasets/llm-jp/jhle)(ライセンス MIT License)
|
| 394 |
-
|
| 395 |
-
**CG(コード生成)**
|
| 396 |
-
|
| 397 |
-
* `MBPP`、Mostly Basic Python Problems(MBPP)の日本語版 [ソース](https://huggingface.co/datasets/llm-jp/mbpp-ja)(ライセンス CC BY-SA 4.0)
|
| 398 |
-
|
| 399 |
-
**SUM(要約)**
|
| 400 |
-
|
| 401 |
-
* `XL-Sum`、44言語の大規模多言語抽象型要約データセットの日本語部分 [ソース](https://github.com/csebuetnlp/xl-sum)(ライセンス CC BY-NC-SA 4.0、非商用ライセンスのため、このデータセットは使用しません。ライセンスと利用規約に明確に同意した場合を除きます)
|
| 402 |
-
|
| 403 |
-
## 再現性
|
| 404 |
-
結果を再現するには、評価ツール **llm-jp-eval** の指示に従ってください。詳細は [日本語](https://github.com/llm-jp/llm-jp-eval/blob/main/README.md) と [英語](https://github.com/llm-jp/llm-jp-eval/blob/main/README_en.md) でご覧いただけます。
|
| 405 |
-
|
| 406 |
-
## 平均スコアの計算について
|
| 407 |
-
平均スコア (AVG) の計算には、⭐マークのついたスコアのみが含まれます
|
| 408 |
-
|
| 409 |
-
## データセット詳細
|
| 410 |
-
リーダーボードで使用されている全データセットの包括的な情報(詳細な説明、データソース、前処理方法、jaster訓練データセットなど)については、llm-jp-evalリポジトリの[DATASET.md](https://github.com/llm-jp/llm-jp-eval/blob/main/DATASET.md)をご参照ください。
|
| 411 |
|
|
|
|
| 412 |
"""
|
| 413 |
|
| 414 |
-
|
| 415 |
EVALUATION_QUEUE_TEXT = """
|
| 416 |
-
##
|
| 417 |
-
|
| 418 |
-
|
| 419 |
```python
|
| 420 |
from transformers import AutoConfig, AutoModel, AutoTokenizer
|
| 421 |
config = AutoConfig.from_pretrained("your model name", revision=revision)
|
| 422 |
model = AutoModel.from_pretrained("your model name", revision=revision)
|
| 423 |
tokenizer = AutoTokenizer.from_pretrained("your model name", revision=revision)
|
| 424 |
```
|
| 425 |
-
|
| 426 |
-
- If this step fails, debug your model before submitting.
|
| 427 |
-
- Ensure your model is public.
|
| 428 |
-
- Models requiring `use_remote_code=True` are not currently supported.
|
| 429 |
-
### 2. Convert Weights to Safetensors
|
| 430 |
-
[Safetensors](https://huggingface.co/docs/safetensors/index) is a new format for storing weights which is safer and faster to load and use. It will also allow us to add the number of parameters of your model to the `Extended Viewer`!
|
| 431 |
-
### 3. Verify Your Model Open License
|
| 432 |
-
This is a leaderboard for Open LLMs, and we'd love for as many people as possible to know they can use your model 🤗
|
| 433 |
-
### 4. Complete Your Model Card
|
| 434 |
-
When we add extra information about models to the leaderboard, it will be automatically taken from the model card
|
| 435 |
-
### 5. Select Appropriate Precision
|
| 436 |
-
The "auto" option supports fp16, fp32, and bf16 precisions. If your model uses any other precision format, please select the appropriate option.
|
| 437 |
-
If auto is specified, precision in config.json is automatically selected.
|
| 438 |
-
### 6. Inference-time Options
|
| 439 |
-
Our evaluation system supports various inference-time parameters:
|
| 440 |
-
|
| 441 |
-
#### Thinking Parameter
|
| 442 |
-
Models that support the `thinking` parameter (e.g., DeepSeek-R1, QwQ) can be evaluated with this feature enabled. When submitting your model, you can specify whether to use the thinking parameter in the submission form.
|
| 443 |
|
| 444 |
-
###
|
| 445 |
-
|
| 446 |
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
### Note about large models
|
| 450 |
-
Currently, we officially support models up to 70B parameters. Depending on the model architecture, models larger than 70B may also be evaluated successfully, but we cannot guarantee this will always be the case.
|
| 451 |
-
|
| 452 |
-
### Evaluation Timeout
|
| 453 |
-
Each evaluation job has a **30-hour timeout limit**. If the inference does not complete within this time, the evaluation will be marked as **failed**. This may occur with very large models or when computational resources are constrained.
|
| 454 |
|
|
|
|
|
|
|
| 455 |
"""
|
|
|
|
| 456 |
EVALUATION_QUEUE_TEXT_JA = """
|
| 457 |
-
## モデル提出前の
|
| 458 |
-
|
| 459 |
-
|
| 460 |
```python
|
| 461 |
from transformers import AutoConfig, AutoModel, AutoTokenizer
|
| 462 |
config = AutoConfig.from_pretrained("your model name", revision=revision)
|
| 463 |
model = AutoModel.from_pretrained("your model name", revision=revision)
|
| 464 |
tokenizer = AutoTokenizer.from_pretrained("your model name", revision=revision)
|
| 465 |
```
|
| 466 |
-
|
| 467 |
-
- この手順が失敗する場合は、提出前にモデルをデバッグしてください。
|
| 468 |
-
- モデルが公開されていることを確認してください。
|
| 469 |
-
- `use_remote_code=True` を必要とするモデルは現時点ではサポートされていません。
|
| 470 |
-
|
| 471 |
-
### 2. 重みを Safetensors に変換
|
| 472 |
-
[Safetensors](https://huggingface.co/docs/safetensors/index) は、より安全で高速に読み込めるウェイトの新しい保存形式です。これにより、`Extended Viewer` にモデルのパラメータ数を追加することも可能になります!
|
| 473 |
-
|
| 474 |
-
### 3. モデルのオープンライセンスを確認
|
| 475 |
-
これはオープン LLM のリーダーボードです。できるだけ多くの人があなたのモデルを使用できることを知ってもらえると嬉しいです🤗
|
| 476 |
-
|
| 477 |
-
### 4. モデルカードを完成させる
|
| 478 |
-
リーダーボードにモデルの追加情報を掲載する際は、モデルカードから自動的に情報が取得されます
|
| 479 |
|
| 480 |
-
###
|
| 481 |
-
|
| 482 |
-
また、autoを指定した場合、config.jsonのprecisionが自動的に選択されます。
|
| 483 |
|
| 484 |
-
###
|
| 485 |
-
|
| 486 |
|
| 487 |
-
###
|
| 488 |
-
|
| 489 |
-
Reasoning Parserを対応するモデルのものに変更してください。
|
| 490 |
-
|
| 491 |
-
### 大規模モデルに関する注意
|
| 492 |
-
現在、70Bパラメータまでのモデルを公式にサポートしています。モデルのアーキテクチャによっては70Bを超えるモデルでも評価できる場合がありますが、必ずしも動作を保証するものではありませんのでご了承ください。
|
| 493 |
-
|
| 494 |
-
### 評価のタイムアウト
|
| 495 |
-
各評価ジョブには**30時間のタイムアウト制限**が設定されています。この時間内に推論が完了しない場合、評価は**failed**(失敗)としてマークされます。これは非常に大規模なモデルや計算リソースが制約されている場合に発生することがあります。
|
| 496 |
-
|
| 497 |
-
"""
|
| 498 |
-
|
| 499 |
-
BOTTOM_LOGO = """
|
| 500 |
-
<div style="display: flex; flex-direction: row; justify-content: center; align-items: center;">
|
| 501 |
-
<a href="https://llm-jp.nii.ac.jp/en/" style="margin: 0 10px;">
|
| 502 |
-
<img src="https://raw.githubusercontent.com/AkimfromParis/akimfromparis/refs/heads/main/images/LLM-jp-Logo-Oct-2024.png" alt="LLM-jp" style="max-height: 100px;">
|
| 503 |
-
</a>
|
| 504 |
-
<a href="https://mdx.jp/" style="margin: 0 10px;">
|
| 505 |
-
<img src="https://raw.githubusercontent.com/AkimfromParis/akimfromparis/refs/heads/main/images/MDX-Logo-Oct-2024.jpg" alt="MDX" style="max-height: 100px;">
|
| 506 |
-
</a>
|
| 507 |
-
<a href="https://huggingface.co/" style="margin: 0 10px;">
|
| 508 |
-
<img src="https://raw.githubusercontent.com/AkimfromParis/akimfromparis/refs/heads/main/images/HuggingFace-Logo-Oct-2024.png" alt="HuggingFace" style="max-height: 100px;">
|
| 509 |
-
</a>
|
| 510 |
-
</div>
|
| 511 |
"""
|
| 512 |
|
| 513 |
-
CITATION_BUTTON_LABEL = "
|
| 514 |
-
CITATION_BUTTON_LABEL_JA = "引用
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
howpublished = "\url{https://huggingface.co/spaces/llm-jp/open-japanese-llm-leaderboard}"
|
| 522 |
-
}
|
| 523 |
-
@misc{llmjp2024llmjpcrossorganizationalprojectresearch,
|
| 524 |
-
title={LLM-jp: A Cross-organizational Project for the Research and Development of Fully Open Japanese LLMs},
|
| 525 |
-
author={LLM-jp and : and Akiko Aizawa and Eiji Aramaki and Bowen Chen and Fei Cheng and Hiroyuki Deguchi and Rintaro Enomoto and Kazuki Fujii and Kensuke Fukumoto and Takuya Fukushima and Namgi Han and Yuto Harada and Chikara Hashimoto and Tatsuya Hiraoka and Shohei Hisada and Sosuke Hosokawa and Lu Jie and Keisuke Kamata and Teruhito Kanazawa and Hiroki Kanezashi and Hiroshi Kataoka and Satoru Katsumata and Daisuke Kawahara and Seiya Kawano and Atsushi Keyaki and Keisuke Kiryu and Hirokazu Kiyomaru and Takashi Kodama and Takahiro Kubo and Yohei Kuga and Ryoma Kumon and Shuhei Kurita and Sadao Kurohashi and Conglong Li and Taiki Maekawa and Hiroshi Matsuda and Yusuke Miyao and Kentaro Mizuki and Sakae Mizuki and Yugo Murawaki and Ryo Nakamura and Taishi Nakamura and Kouta Nakayama and Tomoka Nakazato and Takuro Niitsuma and Jiro Nishitoba and Yusuke Oda and Hayato Ogawa and Takumi Okamoto and Naoaki Okazaki and Yohei Oseki and Shintaro Ozaki and Koki Ryu and Rafal Rzepka and Keisuke Sakaguchi and Shota Sasaki and Satoshi Sekine and Kohei Suda and Saku Sugawara and Issa Sugiura and Hiroaki Sugiyama and Hisami Suzuki and Jun Suzuki and Toyotaro Suzumura and Kensuke Tachibana and Yu Takagi and Kyosuke Takami and Koichi Takeda and Masashi Takeshita and Masahiro Tanaka and Kenjiro Taura and Arseny Tolmachev and Nobuhiro Ueda and Zhen Wan and Shuntaro Yada and Sakiko Yahata and Yuya Yamamoto and Yusuke Yamauchi and Hitomi Yanaka and Rio Yokota and Koichiro Yoshino},
|
| 526 |
-
year={2024},
|
| 527 |
-
eprint={2407.03963},
|
| 528 |
-
archivePrefix={arXiv},
|
| 529 |
-
primaryClass={cs.CL},
|
| 530 |
-
url={https://arxiv.org/abs/2407.03963},
|
| 531 |
}
|
| 532 |
"""
|
|
|
|
|
|
|
|
|
| 1 |
from dataclasses import dataclass
|
| 2 |
from enum import Enum
|
| 3 |
|
| 4 |
+
from src.upstream import load_upstream_eval_config
|
| 5 |
+
|
| 6 |
|
| 7 |
class TaskType(Enum):
|
| 8 |
AVG = "Average - 平均"
|
|
|
|
| 14 |
FA = "FA - 基礎分析"
|
| 15 |
MR = "MR - 数学的推論"
|
| 16 |
MT = "MT - 機械翻訳"
|
|
|
|
| 17 |
HE_EN = "HE-EN - 英語試験問題"
|
| 18 |
HE_JA = "HE-JA - 日本語試験問題"
|
| 19 |
CG = "CG - コード生成"
|
| 20 |
SUM = "SUM - 要約"
|
| 21 |
BBH = "BBH - Big-Bench Hard"
|
| 22 |
IF = "IF - 指示追従"
|
| 23 |
+
LM = "LM - 言語モデリング"
|
| 24 |
NotTask = "?"
|
| 25 |
|
| 26 |
|
| 27 |
+
# yaml category 名 → TaskType の対応
|
| 28 |
+
_CATEGORY_TO_TASK_TYPE: dict[str, TaskType] = {
|
| 29 |
+
"NLI": TaskType.NLI,
|
| 30 |
+
"QA": TaskType.QA,
|
| 31 |
+
"RC": TaskType.RC,
|
| 32 |
+
"CR": TaskType.CR,
|
| 33 |
+
"EL": TaskType.EL,
|
| 34 |
+
"FA": TaskType.FA,
|
| 35 |
+
"MR": TaskType.MR,
|
| 36 |
+
"MT": TaskType.MT,
|
| 37 |
+
"HE-EN": TaskType.HE_EN,
|
| 38 |
+
"HE-JA": TaskType.HE_JA,
|
| 39 |
+
"CG": TaskType.CG,
|
| 40 |
+
"SUM": TaskType.SUM,
|
| 41 |
+
"BBH": TaskType.BBH,
|
| 42 |
+
"IF": TaskType.IF,
|
| 43 |
+
"LM": TaskType.LM,
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
# dataset 名 → 表示名のオーバーライド (ここに無い dataset は _auto_display_name で生成)
|
| 47 |
+
_DISPLAY_NAME_OVERRIDES: dict[str, str] = {
|
| 48 |
+
"aime2024": "AIME 2024",
|
| 49 |
+
"aime2025": "AIME 2025",
|
| 50 |
+
"aio": "JAQKET",
|
| 51 |
+
"alt-e-to-j": "ALT E to J",
|
| 52 |
+
"alt-j-to-e": "ALT J to E",
|
| 53 |
+
"bigbenchhard_cot": "BBH CoT",
|
| 54 |
+
"bigbenchhard_direct": "BBH Direct",
|
| 55 |
+
"bigbenchhard_ja_cot": "BBH JA CoT",
|
| 56 |
+
"bigbenchhard_ja_direct": "BBH JA Direct",
|
| 57 |
+
"chabsa": "ChABSA",
|
| 58 |
+
"commonsensemoralja": "CommonSenseMoralJA",
|
| 59 |
+
"drop": "DROP",
|
| 60 |
+
"gpqa_diamond_en": "GPQA Diamond EN",
|
| 61 |
+
"gpqa_diamond_ja": "GPQA Diamond JA",
|
| 62 |
+
"gpqa_extended_en": "GPQA Extended EN",
|
| 63 |
+
"gpqa_extended_ja": "GPQA Extended JA",
|
| 64 |
+
"gpqa_main_en": "GPQA Main EN",
|
| 65 |
+
"gpqa_main_ja": "GPQA Main JA",
|
| 66 |
+
"gsm8k": "GSM8K",
|
| 67 |
+
"hle": "HLE",
|
| 68 |
+
"jamc-qa": "JAMC-QA",
|
| 69 |
+
"jamp": "JAMP",
|
| 70 |
+
"janli": "JANLI",
|
| 71 |
+
"jcommonsenseqa": "JCommonSenseQA",
|
| 72 |
+
"jemhopqa": "JEMHopQA",
|
| 73 |
+
"jhumaneval": "JHumanEval",
|
| 74 |
+
"jhle": "JHLE",
|
| 75 |
+
"jmmlu": "JMMLU",
|
| 76 |
+
"jnli": "JNLI",
|
| 77 |
+
"jsem": "JSEM",
|
| 78 |
+
"jsick": "JSICK",
|
| 79 |
+
"jsquad": "JSQuAD",
|
| 80 |
+
"kuci": "KUCI",
|
| 81 |
+
"mawps": "MAWPS",
|
| 82 |
+
"mbpp": "MBPP",
|
| 83 |
+
"mgsm": "MGSM",
|
| 84 |
+
"mif_eval_en": "MIF Eval EN",
|
| 85 |
+
"mif_eval_ja": "MIF Eval JA",
|
| 86 |
+
"mmlu_en": "MMLU",
|
| 87 |
+
"mmlu_prox_en": "MMLU Prox EN",
|
| 88 |
+
"mmlu_prox_ja": "MMLU Prox JA",
|
| 89 |
+
"mmmlu": "MMMLU",
|
| 90 |
+
"niilc": "NIILC",
|
| 91 |
+
"openbookqa": "OpenBookQA",
|
| 92 |
+
"polymath-en": "Polymath EN",
|
| 93 |
+
"polymath-ja": "Polymath JA",
|
| 94 |
+
"triviaqa": "TriviaQA",
|
| 95 |
+
"wiki_coreference": "Wiki Coreference",
|
| 96 |
+
"wiki_dependency": "Wiki Dependency",
|
| 97 |
+
"wiki_ner": "Wiki NER",
|
| 98 |
+
"wiki_pas": "Wiki PAS",
|
| 99 |
+
"wiki_reading": "Wiki Reading",
|
| 100 |
+
"wikicorpus-e-to-j": "WikiCorpus E to J",
|
| 101 |
+
"wikicorpus-j-to-e": "WikiCorpus J to E",
|
| 102 |
+
"winogrande_xl": "WinoGrande XL",
|
| 103 |
+
"xlsum_ja": "XL-Sum JA",
|
| 104 |
+
"jfinqa": "JFinQA",
|
| 105 |
+
"structeval": "StructEval",
|
| 106 |
+
"jculture-mcq": "JCulture-MCQ",
|
| 107 |
+
"jblimp": "JBLiMP",
|
| 108 |
+
"jcola-in-domain": "JCoLA (In-Domain)",
|
| 109 |
+
"jcola-out-of-domain": "JCoLA (Out-of-Domain)",
|
| 110 |
+
"jsts": "JSTS",
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
|
| 114 |
@dataclass
|
| 115 |
class Task:
|
| 116 |
benchmark: str
|
|
|
|
| 120 |
average: bool = False
|
| 121 |
|
| 122 |
|
| 123 |
+
def _auto_display_name(dataset_name: str) -> str:
|
| 124 |
+
return dataset_name.replace("_", " ").replace("-", " ").title()
|
| 125 |
+
|
| 126 |
+
|
| 127 |
+
def _build_tasks(yaml_config: dict) -> list[Task]:
|
| 128 |
+
"""upstream yaml config から Tasks リストを動的に構築する。"""
|
| 129 |
+
categories = yaml_config["categories"]
|
| 130 |
+
tasks: list[Task] = []
|
| 131 |
+
|
| 132 |
+
tasks.append(Task("scores", "AVG", "AVG", TaskType.AVG, average=True))
|
| 133 |
+
|
| 134 |
+
for cat_name, _cat_def in categories.items():
|
| 135 |
+
task_type = _CATEGORY_TO_TASK_TYPE.get(cat_name, TaskType.NotTask)
|
| 136 |
+
tasks.append(Task("scores", cat_name, f"AVG ({cat_name})", task_type, average=True))
|
| 137 |
+
|
| 138 |
+
# upstream yaml に未反映の metric override を補完
|
| 139 |
+
_local_metric_fixes: dict[str, str] = {
|
| 140 |
+
"jculture-mcq": "set_f1",
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
for cat_name, cat_def in categories.items():
|
| 144 |
+
task_type = _CATEGORY_TO_TASK_TYPE.get(cat_name, TaskType.NotTask)
|
| 145 |
+
default_metric = cat_def["default_metric"]
|
| 146 |
+
metric_overrides = cat_def.get("metrics", {})
|
| 147 |
+
for ds in cat_def["datasets"]:
|
| 148 |
+
metric = _local_metric_fixes.get(ds) or metric_overrides.get(ds, default_metric)
|
| 149 |
+
metric_col = f"{ds}_{metric}"
|
| 150 |
+
display_name = _DISPLAY_NAME_OVERRIDES.get(ds, _auto_display_name(ds))
|
| 151 |
+
tasks.append(Task("scores", metric_col, display_name, task_type))
|
| 152 |
+
|
| 153 |
+
return tasks
|
| 154 |
+
|
| 155 |
+
|
| 156 |
+
Tasks = _build_tasks(load_upstream_eval_config())
|
| 157 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
TITLE = """<h1 align="center" id="space-title">🇯🇵 Open Japanese LLM Leaderboard V2 🌸<br>オープン日本語LLMリーダーボード V2</h1>"""
|
| 159 |
|
|
|
|
| 160 |
INTRODUCTION_TEXT = """
|
| 161 |
The __Open Japanese LLM Leaderboard__ by __[LLM-jp](https://llm-jp.nii.ac.jp/en/)__ evaluates
|
| 162 |
the performance of Japanese Large Language Models (LLMs) across 14 categories covering more than 71 tasks from
|
|
|
|
| 185 |
参加することができます。
|
| 186 |
"""
|
| 187 |
|
|
|
|
| 188 |
LLM_BENCHMARKS_TEXT = """
|
| 189 |
## How it works
|
| 190 |
📈 We evaluate Japanese Large Language Models across 14 categories covering more than 71 tasks leveraging our evaluation tool [llm-jp-eval](https://github.com/llm-jp/llm-jp-eval), a unified framework to evaluate Japanese LLMs on various evaluation tasks.
|
| 191 |
|
| 192 |
+
For more details, see the [llm-jp-eval](https://github.com/llm-jp/llm-jp-eval) documentation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 193 |
"""
|
| 194 |
|
| 195 |
LLM_BENCHMARKS_TEXT_JA = """
|
| 196 |
## 仕組み
|
| 197 |
+
📈 評価ツール [llm-jp-eval](https://github.com/llm-jp/llm-jp-eval) を活用し、14カテゴリ・71以上のタスクで日本語大規模言語モデルを評価しています。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 198 |
|
| 199 |
+
詳細は [llm-jp-eval](https://github.com/llm-jp/llm-jp-eval) のドキュメントをご覧ください。
|
| 200 |
"""
|
| 201 |
|
|
|
|
| 202 |
EVALUATION_QUEUE_TEXT = """
|
| 203 |
+
## Some good practices before submitting a model
|
| 204 |
+
|
| 205 |
+
### 1) Make sure you can load your model and tokenizer using AutoClasses:
|
| 206 |
```python
|
| 207 |
from transformers import AutoConfig, AutoModel, AutoTokenizer
|
| 208 |
config = AutoConfig.from_pretrained("your model name", revision=revision)
|
| 209 |
model = AutoModel.from_pretrained("your model name", revision=revision)
|
| 210 |
tokenizer = AutoTokenizer.from_pretrained("your model name", revision=revision)
|
| 211 |
```
|
| 212 |
+
If this step fails, follow the error messages to debug your model before submitting it. It's likely your model has been improperly uploaded.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 213 |
|
| 214 |
+
### 2) Convert your model weights to [safetensors](https://huggingface.co/docs/safetensors/index)
|
| 215 |
+
It's a new format for storing weights which is safer and faster to load and use. It will also allow us to add the number of parameters of your model to the `Extended Viewer`!
|
| 216 |
|
| 217 |
+
### 3) Make sure your model has an open license!
|
| 218 |
+
This is a leaderboard for Open LLMs, and we'd love for as many people as possible to know they can use your model 🤗
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 219 |
|
| 220 |
+
### 4) Fill up your model card
|
| 221 |
+
When we add extra information about models to the leaderboard, it will be automatically taken from the model card
|
| 222 |
"""
|
| 223 |
+
|
| 224 |
EVALUATION_QUEUE_TEXT_JA = """
|
| 225 |
+
## モデル提出前の確認事項
|
| 226 |
+
|
| 227 |
+
### 1) AutoClassesでモデルとトークナイザーが読み込めることを確認:
|
| 228 |
```python
|
| 229 |
from transformers import AutoConfig, AutoModel, AutoTokenizer
|
| 230 |
config = AutoConfig.from_pretrained("your model name", revision=revision)
|
| 231 |
model = AutoModel.from_pretrained("your model name", revision=revision)
|
| 232 |
tokenizer = AutoTokenizer.from_pretrained("your model name", revision=revision)
|
| 233 |
```
|
| 234 |
+
このステップが失敗する場合は、エラーメッセージに従ってモデルをデバッグしてください。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 235 |
|
| 236 |
+
### 2) モデルの重みを[safetensors](https://huggingface.co/docs/safetensors/index)に変換
|
| 237 |
+
安全で高速に読み込める新しいフォーマットです。
|
|
|
|
| 238 |
|
| 239 |
+
### 3) モデルにオープンライセンスがあることを確認
|
| 240 |
+
オープンLLMのリーダーボードです。できるだけ多くの人がモデルを使えるようにしましょう 🤗
|
| 241 |
|
| 242 |
+
### 4) モデルカードを記入
|
| 243 |
+
リーダーボードに追加情報が表示される際、モデルカードから自動的に取得されます。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 244 |
"""
|
| 245 |
|
| 246 |
+
CITATION_BUTTON_LABEL = "Citation"
|
| 247 |
+
CITATION_BUTTON_LABEL_JA = "引用"
|
| 248 |
+
CITATION_BUTTON_TEXT = r"""
|
| 249 |
+
@misc{open-japanese-llm-leaderboard-v2,
|
| 250 |
+
author = {LLM-jp},
|
| 251 |
+
title = {Open Japanese LLM Leaderboard V2},
|
| 252 |
+
year = {2025},
|
| 253 |
+
howpublished = {\url{https://huggingface.co/spaces/llm-jp/open-japanese-llm-leaderboard-v2}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 254 |
}
|
| 255 |
"""
|
| 256 |
+
|
| 257 |
+
BOTTOM_LOGO = ""
|
src/display/utils.py
CHANGED
|
@@ -10,9 +10,6 @@ def fields(raw_class):
|
|
| 10 |
return [v for k, v in raw_class.__dict__.items() if k[:2] != "__" and k[-2:] != "__"]
|
| 11 |
|
| 12 |
|
| 13 |
-
# These classes are for user facing column names,
|
| 14 |
-
# to avoid having to change them all around the code
|
| 15 |
-
# when a modif is needed
|
| 16 |
@dataclass(frozen=True)
|
| 17 |
class ColumnContent:
|
| 18 |
name: str
|
|
@@ -25,26 +22,24 @@ class ColumnContent:
|
|
| 25 |
average: bool = False
|
| 26 |
|
| 27 |
|
| 28 |
-
## Leaderboard columns
|
| 29 |
auto_eval_column_dict = []
|
| 30 |
-
|
| 31 |
auto_eval_column_dict.append(["model_type_symbol", ColumnContent, ColumnContent("T", "str", True, never_hidden=True)])
|
| 32 |
auto_eval_column_dict.append(["model", ColumnContent, ColumnContent("Model", "markdown", True, never_hidden=True)])
|
| 33 |
-
# Scores
|
| 34 |
-
# auto_eval_column_dict.append(["average", ColumnContent, ColumnContent("Average ⬆️", "number", True)])
|
| 35 |
for task in Tasks:
|
|
|
|
|
|
|
| 36 |
auto_eval_column_dict.append([
|
| 37 |
-
|
| 38 |
ColumnContent,
|
| 39 |
ColumnContent(
|
| 40 |
-
task.
|
| 41 |
"number",
|
| 42 |
-
displayed_by_default=(task.
|
| 43 |
-
task_type=task.
|
| 44 |
-
average=task.
|
| 45 |
),
|
| 46 |
])
|
| 47 |
-
# Model information
|
| 48 |
auto_eval_column_dict.append(["model_type", ColumnContent, ColumnContent("Type", "str", False)])
|
| 49 |
auto_eval_column_dict.append(["architecture", ColumnContent, ColumnContent("Architecture", "str", False)])
|
| 50 |
auto_eval_column_dict.append(["weight_type", ColumnContent, ColumnContent("Weight type", "str", False, True)])
|
|
@@ -61,12 +56,10 @@ auto_eval_column_dict.append(["co2_emission", ColumnContent, ColumnContent("CO2
|
|
| 61 |
auto_eval_column_dict.append(["dummy", ColumnContent, ColumnContent("model_name_for_query", "str", False, dummy=True)])
|
| 62 |
auto_eval_column_dict.append(["row_id", ColumnContent, ColumnContent("ID", "number", False, dummy=True)])
|
| 63 |
|
| 64 |
-
# We use make dataclass to dynamically fill the scores from Tasks
|
| 65 |
AutoEvalColumn = make_dataclass("AutoEvalColumn", auto_eval_column_dict)
|
| 66 |
|
| 67 |
|
| 68 |
-
|
| 69 |
-
class EvalQueueColumn: # Queue column (not a dataclass - used as class attributes)
|
| 70 |
model = ColumnContent("model", "markdown", True)
|
| 71 |
revision = ColumnContent("revision", "str", True)
|
| 72 |
model_type = ColumnContent("model_type", "str", True)
|
|
@@ -83,21 +76,6 @@ class EvalQueueColumn: # Queue column (not a dataclass - used as class attribut
|
|
| 83 |
reasoning_parser = ColumnContent("reasoning_parser", "str", False)
|
| 84 |
|
| 85 |
|
| 86 |
-
# This class is used to store the model data in the queue
|
| 87 |
-
@dataclass(frozen=True)
|
| 88 |
-
class EvalQueuedModel:
|
| 89 |
-
model: str
|
| 90 |
-
revision: str
|
| 91 |
-
precision: str
|
| 92 |
-
add_special_tokens: str
|
| 93 |
-
llm_jp_eval_version: str
|
| 94 |
-
vllm_version: str
|
| 95 |
-
apply_chat_template: bool = False
|
| 96 |
-
enable_thinking: bool = False
|
| 97 |
-
reasoning_parser: str = ""
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
## All the model information that we might need
|
| 101 |
@dataclass
|
| 102 |
class ModelDetails:
|
| 103 |
name: str
|
|
@@ -173,7 +151,7 @@ class ApplyChatTemplate(Enum):
|
|
| 173 |
|
| 174 |
|
| 175 |
class LLMJpEvalVersion(Enum):
|
| 176 |
-
current = ModelDetails("v2.
|
| 177 |
|
| 178 |
@classmethod
|
| 179 |
def from_str(cls, version: str) -> "LLMJpEvalVersion":
|
|
@@ -192,14 +170,13 @@ class VllmVersion(Enum):
|
|
| 192 |
raise ValueError(f"Unsupported VLLM version: {version}")
|
| 193 |
|
| 194 |
|
| 195 |
-
# Column selection
|
| 196 |
COLS = [c.name for c in fields(AutoEvalColumn) if not c.hidden]
|
| 197 |
TYPES = [c.type for c in fields(AutoEvalColumn)]
|
| 198 |
|
| 199 |
EVAL_COLS = [c.name for c in fields(EvalQueueColumn)]
|
| 200 |
EVAL_TYPES = [c.type for c in fields(EvalQueueColumn)]
|
| 201 |
|
| 202 |
-
BENCHMARK_COLS = [t.
|
| 203 |
|
| 204 |
NUMERIC_INTERVALS = {
|
| 205 |
"0~3B": pd.Interval(0, 3, closed="right"),
|
|
|
|
| 10 |
return [v for k, v in raw_class.__dict__.items() if k[:2] != "__" and k[-2:] != "__"]
|
| 11 |
|
| 12 |
|
|
|
|
|
|
|
|
|
|
| 13 |
@dataclass(frozen=True)
|
| 14 |
class ColumnContent:
|
| 15 |
name: str
|
|
|
|
| 22 |
average: bool = False
|
| 23 |
|
| 24 |
|
|
|
|
| 25 |
auto_eval_column_dict = []
|
| 26 |
+
|
| 27 |
auto_eval_column_dict.append(["model_type_symbol", ColumnContent, ColumnContent("T", "str", True, never_hidden=True)])
|
| 28 |
auto_eval_column_dict.append(["model", ColumnContent, ColumnContent("Model", "markdown", True, never_hidden=True)])
|
|
|
|
|
|
|
| 29 |
for task in Tasks:
|
| 30 |
+
# task.metric をフィールド名に使う (ハイフンはアンダースコアに変換)
|
| 31 |
+
field_name = task.metric.replace("-", "_")
|
| 32 |
auto_eval_column_dict.append([
|
| 33 |
+
field_name,
|
| 34 |
ColumnContent,
|
| 35 |
ColumnContent(
|
| 36 |
+
task.col_name,
|
| 37 |
"number",
|
| 38 |
+
displayed_by_default=(task.task_type == TaskType.AVG or task.average),
|
| 39 |
+
task_type=task.task_type,
|
| 40 |
+
average=task.average,
|
| 41 |
),
|
| 42 |
])
|
|
|
|
| 43 |
auto_eval_column_dict.append(["model_type", ColumnContent, ColumnContent("Type", "str", False)])
|
| 44 |
auto_eval_column_dict.append(["architecture", ColumnContent, ColumnContent("Architecture", "str", False)])
|
| 45 |
auto_eval_column_dict.append(["weight_type", ColumnContent, ColumnContent("Weight type", "str", False, True)])
|
|
|
|
| 56 |
auto_eval_column_dict.append(["dummy", ColumnContent, ColumnContent("model_name_for_query", "str", False, dummy=True)])
|
| 57 |
auto_eval_column_dict.append(["row_id", ColumnContent, ColumnContent("ID", "number", False, dummy=True)])
|
| 58 |
|
|
|
|
| 59 |
AutoEvalColumn = make_dataclass("AutoEvalColumn", auto_eval_column_dict)
|
| 60 |
|
| 61 |
|
| 62 |
+
class EvalQueueColumn:
|
|
|
|
| 63 |
model = ColumnContent("model", "markdown", True)
|
| 64 |
revision = ColumnContent("revision", "str", True)
|
| 65 |
model_type = ColumnContent("model_type", "str", True)
|
|
|
|
| 76 |
reasoning_parser = ColumnContent("reasoning_parser", "str", False)
|
| 77 |
|
| 78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
@dataclass
|
| 80 |
class ModelDetails:
|
| 81 |
name: str
|
|
|
|
| 151 |
|
| 152 |
|
| 153 |
class LLMJpEvalVersion(Enum):
|
| 154 |
+
current = ModelDetails("v2.1.4")
|
| 155 |
|
| 156 |
@classmethod
|
| 157 |
def from_str(cls, version: str) -> "LLMJpEvalVersion":
|
|
|
|
| 170 |
raise ValueError(f"Unsupported VLLM version: {version}")
|
| 171 |
|
| 172 |
|
|
|
|
| 173 |
COLS = [c.name for c in fields(AutoEvalColumn) if not c.hidden]
|
| 174 |
TYPES = [c.type for c in fields(AutoEvalColumn)]
|
| 175 |
|
| 176 |
EVAL_COLS = [c.name for c in fields(EvalQueueColumn)]
|
| 177 |
EVAL_TYPES = [c.type for c in fields(EvalQueueColumn)]
|
| 178 |
|
| 179 |
+
BENCHMARK_COLS = [t.col_name for t in Tasks]
|
| 180 |
|
| 181 |
NUMERIC_INTERVALS = {
|
| 182 |
"0~3B": pd.Interval(0, 3, closed="right"),
|
src/envs.py
CHANGED
|
@@ -20,4 +20,11 @@ CACHE_PATH = pathlib.Path(os.getenv("HF_HOME", "."))
|
|
| 20 |
# Local caches
|
| 21 |
EVAL_REQUESTS_PATH = CACHE_PATH / "eval-queue"
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
API = HfApi(token=HF_TOKEN)
|
|
|
|
| 20 |
# Local caches
|
| 21 |
EVAL_REQUESTS_PATH = CACHE_PATH / "eval-queue"
|
| 22 |
|
| 23 |
+
# llm-jp-eval upstream の dataset 定義 (dev branch を直接参照することで
|
| 24 |
+
# 新 dataset が upstream にマージされた瞬間にフロントが認識する)
|
| 25 |
+
LLM_JP_EVAL_DATASETS_URL = (
|
| 26 |
+
"https://raw.githubusercontent.com/llm-jp/llm-jp-eval/"
|
| 27 |
+
"dev/eval_configs/all_datasets.yaml"
|
| 28 |
+
)
|
| 29 |
+
|
| 30 |
API = HfApi(token=HF_TOKEN)
|
src/populate.py
CHANGED
|
@@ -1,16 +1,14 @@
|
|
| 1 |
import json
|
| 2 |
import os
|
| 3 |
-
from datetime import
|
| 4 |
|
| 5 |
import pandas as pd
|
| 6 |
from huggingface_hub import hf_hub_download
|
| 7 |
|
| 8 |
from src.about import Tasks
|
| 9 |
-
from src.display.formatting import
|
| 10 |
from src.display.utils import AutoEvalColumn, EvalQueueColumn
|
| 11 |
|
| 12 |
-
# The values of these columns are in the range of 0-100
|
| 13 |
-
# We normalize them to 0-1
|
| 14 |
COLUMNS_TO_NORMALIZE = [
|
| 15 |
"ALT E to J BLEU",
|
| 16 |
"ALT J to E BLEU",
|
|
@@ -23,18 +21,22 @@ COLUMNS_TO_NORMALIZE = [
|
|
| 23 |
]
|
| 24 |
|
| 25 |
|
| 26 |
-
def
|
|
|
|
| 27 |
parquet_path = hf_hub_download(
|
| 28 |
repo_id=contents_repo,
|
| 29 |
filename="leaderboard.parquet",
|
| 30 |
repo_type="dataset",
|
| 31 |
)
|
| 32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
df["Model"] = df["model"].map(make_clickable_model)
|
| 34 |
df["T"] = df["model_type"].map(lambda x: x.split(":")[0].strip())
|
| 35 |
-
df = df.rename(columns={task.
|
| 36 |
|
| 37 |
-
# Rename columns only if they exist
|
| 38 |
rename_dict = {
|
| 39 |
"architecture": "Architecture",
|
| 40 |
"weight_type": "Weight type",
|
|
@@ -53,11 +55,9 @@ def get_leaderboard_df(contents_repo: str, cols: list[str], benchmark_cols: list
|
|
| 53 |
"inference_time_seconds": "Inference Time (s)",
|
| 54 |
"co2_emission_kg": "CO2 (kg)",
|
| 55 |
}
|
| 56 |
-
# Only rename columns that exist in the dataframe
|
| 57 |
rename_dict = {k: v for k, v in rename_dict.items() if k in df.columns}
|
| 58 |
df = df.rename(columns=rename_dict)
|
| 59 |
|
| 60 |
-
# Normalize bool columns to string "True"/"False" for consistent filtering
|
| 61 |
bool_columns = ["Add Special Tokens", "Enable Thinking", "Apply Chat Template"]
|
| 62 |
for col in bool_columns:
|
| 63 |
if col in df.columns:
|
|
@@ -65,22 +65,16 @@ def get_leaderboard_df(contents_repo: str, cols: list[str], benchmark_cols: list
|
|
| 65 |
else:
|
| 66 |
df[col] = "False"
|
| 67 |
|
| 68 |
-
# Add a row ID column
|
| 69 |
df[AutoEvalColumn.row_id.name] = range(len(df))
|
| 70 |
|
| 71 |
-
# Normalize the columns
|
| 72 |
available_columns_to_normalize = [col for col in COLUMNS_TO_NORMALIZE if col in df.columns]
|
| 73 |
df[available_columns_to_normalize] = df[available_columns_to_normalize] / 100
|
| 74 |
|
| 75 |
df = df.sort_values(by=[AutoEvalColumn.AVG.name], ascending=False)
|
| 76 |
|
| 77 |
-
# Only select columns that exist
|
| 78 |
available_cols = [col for col in cols if col in df.columns]
|
| 79 |
df = df[available_cols].round(decimals=4)
|
| 80 |
|
| 81 |
-
# filter out if any of the benchmarks have not been produced
|
| 82 |
-
df = df[has_no_nan_values(df, benchmark_cols)]
|
| 83 |
-
|
| 84 |
return df
|
| 85 |
|
| 86 |
|
|
@@ -97,7 +91,7 @@ def _compute_elapsed_time(time_str: str | None) -> str:
|
|
| 97 |
return "-"
|
| 98 |
try:
|
| 99 |
submitted = datetime.fromisoformat(time_str.replace("Z", "+00:00"))
|
| 100 |
-
delta = datetime.now(
|
| 101 |
total_seconds = int(delta.total_seconds())
|
| 102 |
if total_seconds < 0:
|
| 103 |
return "-"
|
|
@@ -176,12 +170,10 @@ def get_evaluation_queue_df(save_path: str, cols: list[str]) -> list[pd.DataFram
|
|
| 176 |
finished_list = [e for e in all_evals if e["status"].startswith("FINISHED") or e["status"] == "PENDING_NEW_EVAL"]
|
| 177 |
failed_list = [e for e in all_evals if e["status"] == "FAILED"]
|
| 178 |
|
| 179 |
-
# Add queue position to pending list (sorted by submitted_time)
|
| 180 |
pending_list = sorted(pending_list, key=lambda x: x.get("submitted_time", ""))
|
| 181 |
for i, entry in enumerate(pending_list):
|
| 182 |
entry["queue_position"] = i + 1
|
| 183 |
|
| 184 |
-
# Running models: position 0 means currently being processed
|
| 185 |
for entry in running_list:
|
| 186 |
entry["queue_position"] = 0
|
| 187 |
|
|
|
|
| 1 |
import json
|
| 2 |
import os
|
| 3 |
+
from datetime import UTC, datetime
|
| 4 |
|
| 5 |
import pandas as pd
|
| 6 |
from huggingface_hub import hf_hub_download
|
| 7 |
|
| 8 |
from src.about import Tasks
|
| 9 |
+
from src.display.formatting import make_clickable_model
|
| 10 |
from src.display.utils import AutoEvalColumn, EvalQueueColumn
|
| 11 |
|
|
|
|
|
|
|
| 12 |
COLUMNS_TO_NORMALIZE = [
|
| 13 |
"ALT E to J BLEU",
|
| 14 |
"ALT J to E BLEU",
|
|
|
|
| 21 |
]
|
| 22 |
|
| 23 |
|
| 24 |
+
def get_raw_leaderboard_df(contents_repo: str) -> pd.DataFrame:
|
| 25 |
+
"""rename / 正規化を行わない素の leaderboard.parquet を返す。"""
|
| 26 |
parquet_path = hf_hub_download(
|
| 27 |
repo_id=contents_repo,
|
| 28 |
filename="leaderboard.parquet",
|
| 29 |
repo_type="dataset",
|
| 30 |
)
|
| 31 |
+
return pd.read_parquet(parquet_path, engine="pyarrow")
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
def get_leaderboard_df(contents_repo: str, cols: list[str], benchmark_cols: list[str]) -> pd.DataFrame: # noqa: ARG001
|
| 35 |
+
df = get_raw_leaderboard_df(contents_repo)
|
| 36 |
df["Model"] = df["model"].map(make_clickable_model)
|
| 37 |
df["T"] = df["model_type"].map(lambda x: x.split(":")[0].strip())
|
| 38 |
+
df = df.rename(columns={task.metric: task.col_name for task in Tasks})
|
| 39 |
|
|
|
|
| 40 |
rename_dict = {
|
| 41 |
"architecture": "Architecture",
|
| 42 |
"weight_type": "Weight type",
|
|
|
|
| 55 |
"inference_time_seconds": "Inference Time (s)",
|
| 56 |
"co2_emission_kg": "CO2 (kg)",
|
| 57 |
}
|
|
|
|
| 58 |
rename_dict = {k: v for k, v in rename_dict.items() if k in df.columns}
|
| 59 |
df = df.rename(columns=rename_dict)
|
| 60 |
|
|
|
|
| 61 |
bool_columns = ["Add Special Tokens", "Enable Thinking", "Apply Chat Template"]
|
| 62 |
for col in bool_columns:
|
| 63 |
if col in df.columns:
|
|
|
|
| 65 |
else:
|
| 66 |
df[col] = "False"
|
| 67 |
|
|
|
|
| 68 |
df[AutoEvalColumn.row_id.name] = range(len(df))
|
| 69 |
|
|
|
|
| 70 |
available_columns_to_normalize = [col for col in COLUMNS_TO_NORMALIZE if col in df.columns]
|
| 71 |
df[available_columns_to_normalize] = df[available_columns_to_normalize] / 100
|
| 72 |
|
| 73 |
df = df.sort_values(by=[AutoEvalColumn.AVG.name], ascending=False)
|
| 74 |
|
|
|
|
| 75 |
available_cols = [col for col in cols if col in df.columns]
|
| 76 |
df = df[available_cols].round(decimals=4)
|
| 77 |
|
|
|
|
|
|
|
|
|
|
| 78 |
return df
|
| 79 |
|
| 80 |
|
|
|
|
| 91 |
return "-"
|
| 92 |
try:
|
| 93 |
submitted = datetime.fromisoformat(time_str.replace("Z", "+00:00"))
|
| 94 |
+
delta = datetime.now(UTC) - submitted
|
| 95 |
total_seconds = int(delta.total_seconds())
|
| 96 |
if total_seconds < 0:
|
| 97 |
return "-"
|
|
|
|
| 170 |
finished_list = [e for e in all_evals if e["status"].startswith("FINISHED") or e["status"] == "PENDING_NEW_EVAL"]
|
| 171 |
failed_list = [e for e in all_evals if e["status"] == "FAILED"]
|
| 172 |
|
|
|
|
| 173 |
pending_list = sorted(pending_list, key=lambda x: x.get("submitted_time", ""))
|
| 174 |
for i, entry in enumerate(pending_list):
|
| 175 |
entry["queue_position"] = i + 1
|
| 176 |
|
|
|
|
| 177 |
for entry in running_list:
|
| 178 |
entry["queue_position"] = 0
|
| 179 |
|
src/submission/check_validity.py
CHANGED
|
@@ -1,15 +1,96 @@
|
|
| 1 |
import json
|
| 2 |
import os
|
| 3 |
-
import pathlib
|
| 4 |
|
| 5 |
import huggingface_hub
|
|
|
|
| 6 |
import requests
|
| 7 |
from huggingface_hub import ModelCard
|
| 8 |
from huggingface_hub.hf_api import ModelInfo
|
| 9 |
from transformers import AutoConfig
|
| 10 |
from transformers.models.auto.tokenization_auto import AutoTokenizer
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
|
| 15 |
def check_model_card(repo_id: str) -> tuple[bool, str]:
|
|
@@ -90,24 +171,3 @@ def get_model_arch(model_info: ModelInfo):
|
|
| 90 |
"""Gets the model architecture from the configuration"""
|
| 91 |
return model_info.config.get("architectures", "Unknown")
|
| 92 |
|
| 93 |
-
|
| 94 |
-
def already_submitted_models(requested_models_dir: pathlib.Path) -> set[EvalQueuedModel]:
|
| 95 |
-
"""Gather a list of already submitted models to avoid duplicates"""
|
| 96 |
-
queued_models = set()
|
| 97 |
-
for json_path in requested_models_dir.glob("*/*.json"):
|
| 98 |
-
with json_path.open() as f:
|
| 99 |
-
info = json.load(f)
|
| 100 |
-
queued_models.add(
|
| 101 |
-
EvalQueuedModel(
|
| 102 |
-
model=info["model"],
|
| 103 |
-
revision=info["revision"],
|
| 104 |
-
precision=info["precision"],
|
| 105 |
-
add_special_tokens=info["add_special_tokens"],
|
| 106 |
-
llm_jp_eval_version=info["llm_jp_eval_version"],
|
| 107 |
-
vllm_version=info["vllm_version"],
|
| 108 |
-
apply_chat_template=info["apply_chat_template"],
|
| 109 |
-
enable_thinking=info["enable_thinking"],
|
| 110 |
-
reasoning_parser=info["reasoning_parser"],
|
| 111 |
-
)
|
| 112 |
-
)
|
| 113 |
-
return queued_models
|
|
|
|
| 1 |
import json
|
| 2 |
import os
|
|
|
|
| 3 |
|
| 4 |
import huggingface_hub
|
| 5 |
+
import pandas as pd
|
| 6 |
import requests
|
| 7 |
from huggingface_hub import ModelCard
|
| 8 |
from huggingface_hub.hf_api import ModelInfo
|
| 9 |
from transformers import AutoConfig
|
| 10 |
from transformers.models.auto.tokenization_auto import AutoTokenizer
|
| 11 |
|
| 12 |
+
# parquet 上のメタ列 (どの dataset の score でもない)
|
| 13 |
+
_LEADERBOARD_META_COLS = frozenset({
|
| 14 |
+
"model_type", "model", "revision", "add_special_tokens",
|
| 15 |
+
"llm_jp_eval_version", "vllm_version", "precision",
|
| 16 |
+
"architecture", "license", "params", "likes", "num_few_shot",
|
| 17 |
+
"apply_chat_template", "enable_thinking", "reasoning_parser",
|
| 18 |
+
"inference_time_seconds", "co2_emission_kg",
|
| 19 |
+
})
|
| 20 |
+
|
| 21 |
+
# parquet 上の集計列 (個別 dataset 由来ではなく category 平均)
|
| 22 |
+
_LEADERBOARD_AGGREGATE_COLS = frozenset({
|
| 23 |
+
"NLI", "QA", "RC", "CR", "HE-JA", "HE-EN", "EL", "FA",
|
| 24 |
+
"MR", "MT", "CG", "SUM", "IF", "BBH", "LM", "AVG",
|
| 25 |
+
})
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
def build_dataset_column_map(
|
| 29 |
+
upstream_datasets: frozenset[str] | set[str],
|
| 30 |
+
parquet_columns: list[str],
|
| 31 |
+
) -> dict[str, list[str]]:
|
| 32 |
+
"""upstream dataset 名と parquet 列名を longest-prefix-match で結びつけ、
|
| 33 |
+
{dataset_name: [属する列名 ...]} の dict を返す。
|
| 34 |
+
|
| 35 |
+
parquet 列は `{dataset}_{metric}` パターンで 1 つの dataset に対し複数列が
|
| 36 |
+
存在する (例: aio_ool, aio_char_f1, aio_exact_match)。各列は最も長く
|
| 37 |
+
マッチする dataset に割り当てられるので、`gpqa_diamond_en` と
|
| 38 |
+
`gpqa_diamond_ja` のような兄弟も衝突しない。
|
| 39 |
+
"""
|
| 40 |
+
sorted_datasets = sorted(upstream_datasets, key=len, reverse=True)
|
| 41 |
+
mapping: dict[str, list[str]] = {d: [] for d in upstream_datasets}
|
| 42 |
+
for col in parquet_columns:
|
| 43 |
+
if col in _LEADERBOARD_META_COLS or col in _LEADERBOARD_AGGREGATE_COLS:
|
| 44 |
+
continue
|
| 45 |
+
for dataset in sorted_datasets:
|
| 46 |
+
if col == dataset or col.startswith(f"{dataset}_"):
|
| 47 |
+
mapping[dataset].append(col)
|
| 48 |
+
break
|
| 49 |
+
return mapping
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
def compute_already_evaluated_datasets(
|
| 53 |
+
df: pd.DataFrame,
|
| 54 |
+
upstream_datasets: frozenset[str] | set[str],
|
| 55 |
+
*,
|
| 56 |
+
model: str,
|
| 57 |
+
revision: str,
|
| 58 |
+
precision: str,
|
| 59 |
+
add_special_tokens: str,
|
| 60 |
+
apply_chat_template: bool,
|
| 61 |
+
enable_thinking: bool,
|
| 62 |
+
) -> set[str]:
|
| 63 |
+
"""parquet から指定モデル設定に該当する行を抽出し、
|
| 64 |
+
各 upstream dataset について「対応する列のいずれかが non-null」なら
|
| 65 |
+
評価済みと判定し、その集合を返す。
|
| 66 |
+
"""
|
| 67 |
+
if df.empty:
|
| 68 |
+
return set()
|
| 69 |
+
|
| 70 |
+
apply_ct_col = df["apply_chat_template"].where(df["apply_chat_template"].notna(), False)
|
| 71 |
+
enable_th_col = df["enable_thinking"].where(df["enable_thinking"].notna(), False)
|
| 72 |
+
cond = (
|
| 73 |
+
(df["model"] == model)
|
| 74 |
+
& (df["revision"] == revision)
|
| 75 |
+
& (df["precision"] == precision)
|
| 76 |
+
& (df["add_special_tokens"] == add_special_tokens)
|
| 77 |
+
& (apply_ct_col == apply_chat_template)
|
| 78 |
+
& (enable_th_col == enable_thinking)
|
| 79 |
+
)
|
| 80 |
+
|
| 81 |
+
matched = df[cond]
|
| 82 |
+
if matched.empty:
|
| 83 |
+
return set()
|
| 84 |
+
|
| 85 |
+
column_map = build_dataset_column_map(upstream_datasets, list(df.columns))
|
| 86 |
+
evaluated: set[str] = set()
|
| 87 |
+
for dataset, cols in column_map.items():
|
| 88 |
+
if not cols:
|
| 89 |
+
# parquet にまだ存在しない dataset (= upstream で新規追加されたばかり)
|
| 90 |
+
continue
|
| 91 |
+
if matched[cols].notna().any().any():
|
| 92 |
+
evaluated.add(dataset)
|
| 93 |
+
return evaluated
|
| 94 |
|
| 95 |
|
| 96 |
def check_model_card(repo_id: str) -> tuple[bool, str]:
|
|
|
|
| 171 |
"""Gets the model architecture from the configuration"""
|
| 172 |
return model_info.config.get("architectures", "Unknown")
|
| 173 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
src/submission/submit.py
CHANGED
|
@@ -1,21 +1,54 @@
|
|
| 1 |
import json
|
| 2 |
-
from datetime import
|
| 3 |
|
| 4 |
import gradio as gr
|
| 5 |
import torch
|
| 6 |
|
| 7 |
from src.display.formatting import styled_error, styled_message, styled_warning
|
| 8 |
-
from src.display.utils import
|
| 9 |
-
from src.envs import API, EVAL_REQUESTS_PATH, HF_TOKEN, QUEUE_REPO
|
| 10 |
-
from src.
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
LLM_JP_EVAL_VERSION = LLMJpEvalVersion.current.value.name
|
| 15 |
VLLM_VERSION = VllmVersion.current.value.name
|
| 16 |
|
| 17 |
|
| 18 |
-
def
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
model_id: str,
|
| 20 |
revision: str,
|
| 21 |
precision: str,
|
|
@@ -24,40 +57,17 @@ def add_new_eval( # noqa: C901
|
|
| 24 |
apply_chat_template: str,
|
| 25 |
enable_thinking: str,
|
| 26 |
reasoning_parser: str,
|
| 27 |
-
profile: gr.OAuthProfile | None
|
| 28 |
-
) -> str:
|
| 29 |
-
"""
|
| 30 |
-
|
| 31 |
-
Args:
|
| 32 |
-
model_id: HuggingFace model ID
|
| 33 |
-
revision: Git revision (branch/tag/commit)
|
| 34 |
-
precision: Model precision (float16/bfloat16/float32/auto)
|
| 35 |
-
model_type: Model type (pretrained/fine-tuned/etc)
|
| 36 |
-
add_special_tokens: Whether to add special tokens
|
| 37 |
-
apply_chat_template: Whether to apply chat template
|
| 38 |
-
enable_thinking: Whether to enable thinking mode
|
| 39 |
-
reasoning_parser: Reasoning parser type (qwen3, etc)
|
| 40 |
-
profile: User's OAuth profile (required for authentication)
|
| 41 |
-
|
| 42 |
-
Returns:
|
| 43 |
-
Status message (success/error)
|
| 44 |
-
"""
|
| 45 |
-
global REQUESTED_MODELS
|
| 46 |
-
|
| 47 |
-
# Check OAuth authentication
|
| 48 |
if profile is None:
|
| 49 |
return styled_error("Please log in with your Hugging Face account to submit a model.")
|
| 50 |
|
| 51 |
-
if not REQUESTED_MODELS:
|
| 52 |
-
REQUESTED_MODELS = already_submitted_models(EVAL_REQUESTS_PATH)
|
| 53 |
-
|
| 54 |
revision = revision or "main"
|
| 55 |
|
| 56 |
-
# Convert string to boolean
|
| 57 |
apply_chat_template_bool = apply_chat_template == "True"
|
| 58 |
enable_thinking_bool = enable_thinking == "True"
|
| 59 |
|
| 60 |
-
# Validate configuration dependencies
|
| 61 |
if enable_thinking_bool:
|
| 62 |
if not apply_chat_template_bool:
|
| 63 |
return styled_error("Enable Thinking requires Apply Chat Template to be True.")
|
|
@@ -66,7 +76,6 @@ def add_new_eval( # noqa: C901
|
|
| 66 |
elif reasoning_parser and reasoning_parser.strip():
|
| 67 |
return styled_error("Reasoning Parser requires Enable Thinking to be True.")
|
| 68 |
|
| 69 |
-
# Is the model on the hub?
|
| 70 |
model_on_hub, error, config = is_model_on_hub(
|
| 71 |
model_name=model_id, revision=revision, token=HF_TOKEN, test_tokenizer=True
|
| 72 |
)
|
|
@@ -87,38 +96,14 @@ def add_new_eval( # noqa: C901
|
|
| 87 |
"Unable to retrieve a valid dtype from config.json. Please select an appropriate one from fp16/fp32/bf16 and resubmit."
|
| 88 |
)
|
| 89 |
|
| 90 |
-
model_data = EvalQueuedModel(
|
| 91 |
-
model=model_id,
|
| 92 |
-
revision=revision,
|
| 93 |
-
precision=precision,
|
| 94 |
-
add_special_tokens=add_special_tokens,
|
| 95 |
-
llm_jp_eval_version=LLM_JP_EVAL_VERSION,
|
| 96 |
-
vllm_version=VLLM_VERSION,
|
| 97 |
-
apply_chat_template=apply_chat_template_bool,
|
| 98 |
-
enable_thinking=enable_thinking_bool,
|
| 99 |
-
reasoning_parser=reasoning_parser,
|
| 100 |
-
)
|
| 101 |
-
|
| 102 |
-
if model_data in REQUESTED_MODELS:
|
| 103 |
-
return styled_warning("This model has already been submitted with the same configuration.")
|
| 104 |
-
|
| 105 |
-
if "/" in model_id:
|
| 106 |
-
user_or_org, model_name = model_id.split("/")
|
| 107 |
-
else:
|
| 108 |
-
user_or_org, model_name = "", model_id
|
| 109 |
-
|
| 110 |
-
current_time = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
|
| 111 |
-
|
| 112 |
if model_type is None or model_type == "":
|
| 113 |
return styled_error("Please select a model type.")
|
| 114 |
|
| 115 |
-
# Is the model info correctly filled?
|
| 116 |
try:
|
| 117 |
model_info = API.model_info(repo_id=model_id, revision=revision)
|
| 118 |
except Exception:
|
| 119 |
return styled_error("Could not get your model information. Please fill it up properly.")
|
| 120 |
|
| 121 |
-
# Were the model card and license filled?
|
| 122 |
try:
|
| 123 |
_ = model_info.cardData["license"]
|
| 124 |
except Exception:
|
|
@@ -128,48 +113,146 @@ def add_new_eval( # noqa: C901
|
|
| 128 |
if not modelcard_ok:
|
| 129 |
return styled_error(error_msg)
|
| 130 |
|
| 131 |
-
|
| 132 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
|
| 134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
"model_type": model_type,
|
| 136 |
"model": model_id,
|
| 137 |
"precision": precision,
|
| 138 |
"revision": revision,
|
| 139 |
"add_special_tokens": add_special_tokens,
|
| 140 |
-
"num_few_shot": 4,
|
| 141 |
"llm_jp_eval_version": LLM_JP_EVAL_VERSION,
|
| 142 |
"vllm_version": VLLM_VERSION,
|
| 143 |
-
"status": "PENDING",
|
| 144 |
-
"submitted_time": current_time,
|
| 145 |
-
"submitted_by": profile.username,
|
| 146 |
"apply_chat_template": apply_chat_template_bool,
|
| 147 |
"enable_thinking": enable_thinking_bool,
|
| 148 |
"reasoning_parser": reasoning_parser if enable_thinking_bool else "",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
}
|
| 150 |
|
| 151 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
out_dir = EVAL_REQUESTS_PATH / user_or_org
|
| 153 |
out_dir.mkdir(parents=True, exist_ok=True)
|
| 154 |
-
out_file_name = f"{model_name}_{
|
| 155 |
out_path = out_dir / out_file_name
|
| 156 |
|
| 157 |
with out_path.open("w") as f:
|
| 158 |
-
f.write(json.dumps(
|
| 159 |
|
| 160 |
-
print("Uploading eval file")
|
| 161 |
API.upload_file(
|
| 162 |
path_or_fileobj=out_path,
|
| 163 |
path_in_repo=out_path.relative_to(EVAL_REQUESTS_PATH).as_posix(),
|
| 164 |
repo_id=QUEUE_REPO,
|
| 165 |
repo_type="dataset",
|
| 166 |
-
commit_message=f"Add {
|
| 167 |
)
|
| 168 |
-
REQUESTED_MODELS.add(model_data)
|
| 169 |
-
|
| 170 |
-
# Remove the local file
|
| 171 |
out_path.unlink()
|
| 172 |
|
| 173 |
return styled_message(
|
| 174 |
-
"Your request has been submitted to the evaluation queue!\
|
| 175 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import json
|
| 2 |
+
from datetime import UTC, datetime
|
| 3 |
|
| 4 |
import gradio as gr
|
| 5 |
import torch
|
| 6 |
|
| 7 |
from src.display.formatting import styled_error, styled_message, styled_warning
|
| 8 |
+
from src.display.utils import LLMJpEvalVersion, VllmVersion
|
| 9 |
+
from src.envs import API, CONTENTS_REPO, EVAL_REQUESTS_PATH, HF_TOKEN, QUEUE_REPO
|
| 10 |
+
from src.populate import get_raw_leaderboard_df
|
| 11 |
+
from src.submission.check_validity import (
|
| 12 |
+
check_model_card,
|
| 13 |
+
compute_already_evaluated_datasets,
|
| 14 |
+
is_model_on_hub,
|
| 15 |
+
load_canonical_dataset_set,
|
| 16 |
+
)
|
| 17 |
+
from src.upstream import load_upstream_eval_config
|
| 18 |
|
| 19 |
LLM_JP_EVAL_VERSION = LLMJpEvalVersion.current.value.name
|
| 20 |
VLLM_VERSION = VllmVersion.current.value.name
|
| 21 |
|
| 22 |
|
| 23 |
+
def _format_datasets_by_category(datasets: list[str]) -> str:
|
| 24 |
+
"""datasets をカテゴリ別に折りたたみ (HTML details) で整形する。"""
|
| 25 |
+
config = load_upstream_eval_config()
|
| 26 |
+
categories = config.get("categories", {})
|
| 27 |
+
|
| 28 |
+
ds_set = set(datasets)
|
| 29 |
+
categorized: dict[str, list[str]] = {}
|
| 30 |
+
assigned: set[str] = set()
|
| 31 |
+
|
| 32 |
+
for cat_name, cat_def in categories.items():
|
| 33 |
+
desc = cat_def.get("description", cat_name)
|
| 34 |
+
matched = [d for d in cat_def["datasets"] if d in ds_set]
|
| 35 |
+
if matched:
|
| 36 |
+
categorized[f"{cat_name} - {desc}"] = matched
|
| 37 |
+
assigned.update(matched)
|
| 38 |
+
|
| 39 |
+
uncategorized = [d for d in datasets if d not in assigned]
|
| 40 |
+
if uncategorized:
|
| 41 |
+
categorized["Other"] = uncategorized
|
| 42 |
+
|
| 43 |
+
lines: list[str] = []
|
| 44 |
+
for cat_label, ds_list in categorized.items():
|
| 45 |
+
items = " ".join(f"`{d}`" for d in ds_list)
|
| 46 |
+
lines.append(f"<details><summary><b>{cat_label}</b> ({len(ds_list)})</summary>\n\n{items}\n\n</details>")
|
| 47 |
+
|
| 48 |
+
return "\n".join(lines)
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
def _validate_and_resolve( # noqa: C901
|
| 52 |
model_id: str,
|
| 53 |
revision: str,
|
| 54 |
precision: str,
|
|
|
|
| 57 |
apply_chat_template: str,
|
| 58 |
enable_thinking: str,
|
| 59 |
reasoning_parser: str,
|
| 60 |
+
profile: gr.OAuthProfile | None,
|
| 61 |
+
) -> dict | str:
|
| 62 |
+
"""Validate inputs and compute differential datasets. Returns eval_entry dict on success, error string on failure."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
if profile is None:
|
| 64 |
return styled_error("Please log in with your Hugging Face account to submit a model.")
|
| 65 |
|
|
|
|
|
|
|
|
|
|
| 66 |
revision = revision or "main"
|
| 67 |
|
|
|
|
| 68 |
apply_chat_template_bool = apply_chat_template == "True"
|
| 69 |
enable_thinking_bool = enable_thinking == "True"
|
| 70 |
|
|
|
|
| 71 |
if enable_thinking_bool:
|
| 72 |
if not apply_chat_template_bool:
|
| 73 |
return styled_error("Enable Thinking requires Apply Chat Template to be True.")
|
|
|
|
| 76 |
elif reasoning_parser and reasoning_parser.strip():
|
| 77 |
return styled_error("Reasoning Parser requires Enable Thinking to be True.")
|
| 78 |
|
|
|
|
| 79 |
model_on_hub, error, config = is_model_on_hub(
|
| 80 |
model_name=model_id, revision=revision, token=HF_TOKEN, test_tokenizer=True
|
| 81 |
)
|
|
|
|
| 96 |
"Unable to retrieve a valid dtype from config.json. Please select an appropriate one from fp16/fp32/bf16 and resubmit."
|
| 97 |
)
|
| 98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
if model_type is None or model_type == "":
|
| 100 |
return styled_error("Please select a model type.")
|
| 101 |
|
|
|
|
| 102 |
try:
|
| 103 |
model_info = API.model_info(repo_id=model_id, revision=revision)
|
| 104 |
except Exception:
|
| 105 |
return styled_error("Could not get your model information. Please fill it up properly.")
|
| 106 |
|
|
|
|
| 107 |
try:
|
| 108 |
_ = model_info.cardData["license"]
|
| 109 |
except Exception:
|
|
|
|
| 113 |
if not modelcard_ok:
|
| 114 |
return styled_error(error_msg)
|
| 115 |
|
| 116 |
+
try:
|
| 117 |
+
canonical_datasets = load_canonical_dataset_set()
|
| 118 |
+
except Exception as e:
|
| 119 |
+
return styled_error(f"Failed to fetch upstream dataset list: {e}")
|
| 120 |
+
|
| 121 |
+
try:
|
| 122 |
+
leaderboard_df = get_raw_leaderboard_df(CONTENTS_REPO)
|
| 123 |
+
except Exception as e:
|
| 124 |
+
return styled_error(f"Failed to load leaderboard.parquet: {e}")
|
| 125 |
+
|
| 126 |
+
already_evaluated = compute_already_evaluated_datasets(
|
| 127 |
+
leaderboard_df,
|
| 128 |
+
canonical_datasets,
|
| 129 |
+
model=model_id,
|
| 130 |
+
revision=revision,
|
| 131 |
+
precision=precision,
|
| 132 |
+
add_special_tokens=add_special_tokens,
|
| 133 |
+
apply_chat_template=apply_chat_template_bool,
|
| 134 |
+
enable_thinking=enable_thinking_bool,
|
| 135 |
+
)
|
| 136 |
+
|
| 137 |
+
datasets_to_run = sorted(canonical_datasets - already_evaluated)
|
| 138 |
+
|
| 139 |
+
if not datasets_to_run:
|
| 140 |
+
return styled_warning(
|
| 141 |
+
"All datasets in the current evaluation set have already been "
|
| 142 |
+
"evaluated for this model configuration."
|
| 143 |
+
)
|
| 144 |
|
| 145 |
+
if "/" in model_id:
|
| 146 |
+
user_or_org, model_name = model_id.split("/")
|
| 147 |
+
else:
|
| 148 |
+
user_or_org, model_name = "", model_id
|
| 149 |
+
|
| 150 |
+
return {
|
| 151 |
"model_type": model_type,
|
| 152 |
"model": model_id,
|
| 153 |
"precision": precision,
|
| 154 |
"revision": revision,
|
| 155 |
"add_special_tokens": add_special_tokens,
|
| 156 |
+
"num_few_shot": 4,
|
| 157 |
"llm_jp_eval_version": LLM_JP_EVAL_VERSION,
|
| 158 |
"vllm_version": VLLM_VERSION,
|
|
|
|
|
|
|
|
|
|
| 159 |
"apply_chat_template": apply_chat_template_bool,
|
| 160 |
"enable_thinking": enable_thinking_bool,
|
| 161 |
"reasoning_parser": reasoning_parser if enable_thinking_bool else "",
|
| 162 |
+
"datasets": datasets_to_run,
|
| 163 |
+
"_user_or_org": user_or_org,
|
| 164 |
+
"_model_name": model_name,
|
| 165 |
+
"_already_evaluated_count": len(already_evaluated),
|
| 166 |
+
"_canonical_count": len(canonical_datasets),
|
| 167 |
}
|
| 168 |
|
| 169 |
+
|
| 170 |
+
def preview_eval(
|
| 171 |
+
model_id: str,
|
| 172 |
+
revision: str,
|
| 173 |
+
precision: str,
|
| 174 |
+
model_type: str,
|
| 175 |
+
add_special_tokens: str,
|
| 176 |
+
apply_chat_template: str,
|
| 177 |
+
enable_thinking: str,
|
| 178 |
+
reasoning_parser: str,
|
| 179 |
+
profile: gr.OAuthProfile | None = None,
|
| 180 |
+
) -> tuple:
|
| 181 |
+
"""Validate and show confirmation modal with dataset list.
|
| 182 |
+
|
| 183 |
+
Returns: (status_text, modal_content, modal_visible, eval_entry_state)
|
| 184 |
+
"""
|
| 185 |
+
result = _validate_and_resolve(
|
| 186 |
+
model_id, revision, precision, model_type,
|
| 187 |
+
add_special_tokens, apply_chat_template,
|
| 188 |
+
enable_thinking, reasoning_parser, profile,
|
| 189 |
+
)
|
| 190 |
+
|
| 191 |
+
if isinstance(result, str):
|
| 192 |
+
return result, "", gr.update(visible=False), None
|
| 193 |
+
|
| 194 |
+
datasets_to_run = result["datasets"]
|
| 195 |
+
already_count = result["_already_evaluated_count"]
|
| 196 |
+
canonical_count = result["_canonical_count"]
|
| 197 |
+
|
| 198 |
+
if already_count > 0:
|
| 199 |
+
header = f"### 差分評価: {len(datasets_to_run)} / {canonical_count} datasets\n{already_count} datasets は既存スコアを流用\n\n"
|
| 200 |
+
else:
|
| 201 |
+
header = f"### フル評価: {len(datasets_to_run)} datasets\n\n"
|
| 202 |
+
|
| 203 |
+
modal_body = header + _format_datasets_by_category(datasets_to_run)
|
| 204 |
+
|
| 205 |
+
return "", modal_body, gr.update(visible=True), result
|
| 206 |
+
|
| 207 |
+
|
| 208 |
+
def confirm_eval(
|
| 209 |
+
eval_entry_state: dict | None,
|
| 210 |
+
profile: gr.OAuthProfile | None = None,
|
| 211 |
+
) -> tuple:
|
| 212 |
+
"""Submit the eval request to queue.
|
| 213 |
+
|
| 214 |
+
Returns: (status_text, modal_visible, state_cleared)
|
| 215 |
+
"""
|
| 216 |
+
if eval_entry_state is None:
|
| 217 |
+
return styled_error("No pending submission. Please click Submit first."), gr.update(visible=False), None
|
| 218 |
+
|
| 219 |
+
if profile is None:
|
| 220 |
+
return styled_error("Please log in with your Hugging Face account."), gr.update(visible=False), None
|
| 221 |
+
|
| 222 |
+
entry = {k: v for k, v in eval_entry_state.items() if not k.startswith("_")}
|
| 223 |
+
entry["status"] = "PENDING"
|
| 224 |
+
entry["submitted_time"] = datetime.now(UTC).strftime("%Y-%m-%dT%H:%M:%SZ")
|
| 225 |
+
entry["submitted_by"] = profile.username
|
| 226 |
+
|
| 227 |
+
user_or_org = eval_entry_state["_user_or_org"]
|
| 228 |
+
model_name = eval_entry_state["_model_name"]
|
| 229 |
+
|
| 230 |
out_dir = EVAL_REQUESTS_PATH / user_or_org
|
| 231 |
out_dir.mkdir(parents=True, exist_ok=True)
|
| 232 |
+
out_file_name = f"{model_name}_{entry['submitted_time'].replace(':', '-')}.json"
|
| 233 |
out_path = out_dir / out_file_name
|
| 234 |
|
| 235 |
with out_path.open("w") as f:
|
| 236 |
+
f.write(json.dumps(entry))
|
| 237 |
|
|
|
|
| 238 |
API.upload_file(
|
| 239 |
path_or_fileobj=out_path,
|
| 240 |
path_in_repo=out_path.relative_to(EVAL_REQUESTS_PATH).as_posix(),
|
| 241 |
repo_id=QUEUE_REPO,
|
| 242 |
repo_type="dataset",
|
| 243 |
+
commit_message=f"Add {entry['model']} to eval queue",
|
| 244 |
)
|
|
|
|
|
|
|
|
|
|
| 245 |
out_path.unlink()
|
| 246 |
|
| 247 |
return styled_message(
|
| 248 |
+
"Your request has been submitted to the evaluation queue!\n"
|
| 249 |
+
"Please wait for up to an hour for the model to show in the PENDING list."
|
| 250 |
+
), gr.update(visible=False), None
|
| 251 |
+
|
| 252 |
+
|
| 253 |
+
def cancel_eval() -> tuple:
|
| 254 |
+
"""Cancel the pending submission.
|
| 255 |
+
|
| 256 |
+
Returns: (status_text, modal_visible, state_cleared)
|
| 257 |
+
"""
|
| 258 |
+
return "Submission cancelled.", gr.update(visible=False), None
|
src/upstream.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""llm-jp-eval upstream から all_datasets.yaml を取得するモジュール。"""
|
| 2 |
+
|
| 3 |
+
import functools
|
| 4 |
+
|
| 5 |
+
import requests
|
| 6 |
+
import yaml
|
| 7 |
+
|
| 8 |
+
from src.envs import LLM_JP_EVAL_DATASETS_URL
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
@functools.lru_cache(maxsize=1)
|
| 12 |
+
def load_upstream_eval_config() -> dict:
|
| 13 |
+
"""llm-jp-eval upstream から all_datasets.yaml の全内容を取得して返す。
|
| 14 |
+
|
| 15 |
+
categories / datasets / dataset_info_overrides を含む dict。
|
| 16 |
+
プロセス起動中は lru_cache で memoize する。
|
| 17 |
+
"""
|
| 18 |
+
response = requests.get(LLM_JP_EVAL_DATASETS_URL, timeout=10)
|
| 19 |
+
response.raise_for_status()
|
| 20 |
+
return yaml.safe_load(response.text)
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def load_canonical_dataset_set() -> frozenset[str]:
|
| 24 |
+
"""upstream yaml の `datasets:` フィールドを frozenset として返す。"""
|
| 25 |
+
return frozenset(load_upstream_eval_config()["datasets"])
|
style.css
CHANGED
|
@@ -141,3 +141,36 @@
|
|
| 141 |
#llm-benchmark-tab-table table th:last-child {
|
| 142 |
display: none;
|
| 143 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
#llm-benchmark-tab-table table th:last-child {
|
| 142 |
display: none;
|
| 143 |
}
|
| 144 |
+
|
| 145 |
+
/* Confirmation modal overlay */
|
| 146 |
+
.confirm-modal-overlay {
|
| 147 |
+
position: fixed !important;
|
| 148 |
+
top: 0 !important;
|
| 149 |
+
left: 0 !important;
|
| 150 |
+
width: 100vw !important;
|
| 151 |
+
height: 100vh !important;
|
| 152 |
+
max-height: 100vh !important;
|
| 153 |
+
background: rgba(0, 0, 0, 0.5) !important;
|
| 154 |
+
z-index: 9999 !important;
|
| 155 |
+
display: flex !important;
|
| 156 |
+
align-items: center !important;
|
| 157 |
+
justify-content: center !important;
|
| 158 |
+
padding: 0 !important;
|
| 159 |
+
margin: 0 !important;
|
| 160 |
+
gap: 0 !important;
|
| 161 |
+
border: none !important;
|
| 162 |
+
flex-grow: 0 !important;
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
.confirm-modal-box {
|
| 166 |
+
background: var(--background-fill-primary);
|
| 167 |
+
border: 1px solid var(--border-color-primary) !important;
|
| 168 |
+
border-radius: 12px;
|
| 169 |
+
padding: 24px !important;
|
| 170 |
+
max-width: 600px;
|
| 171 |
+
width: 90%;
|
| 172 |
+
max-height: 70vh;
|
| 173 |
+
overflow-y: auto;
|
| 174 |
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
|
| 175 |
+
flex-grow: 0 !important;
|
| 176 |
+
}
|