kunato commited on
Commit
cc9a14a
1 Parent(s): edfe6ac

update text

Browse files
Files changed (3) hide show
  1. app.py +26 -10
  2. src/about.py +16 -8
  3. src/pages/result_table.py +9 -3
app.py CHANGED
@@ -16,21 +16,31 @@ from src.display.css_html_js import custom_css
16
  from src.envs import API, EVAL_REQUESTS_PATH, EVAL_RESULTS_PATH, QUEUE_REPO, REPO_ID, RESULTS_REPO, TOKEN
17
 
18
 
19
-
20
  def restart_space():
21
  API.restart_space(repo_id=REPO_ID)
22
 
 
23
  try:
24
  print(EVAL_REQUESTS_PATH)
25
  snapshot_download(
26
- repo_id=QUEUE_REPO, local_dir=EVAL_REQUESTS_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30, token=TOKEN
 
 
 
 
 
27
  )
28
  except Exception:
29
  restart_space()
30
  try:
31
  print(EVAL_RESULTS_PATH)
32
  snapshot_download(
33
- repo_id=RESULTS_REPO, local_dir=EVAL_RESULTS_PATH, repo_type="dataset", tqdm_class=None, etag_timeout=30, token=TOKEN
 
 
 
 
 
34
  )
35
  except Exception:
36
  restart_space()
@@ -42,10 +52,17 @@ with demo:
42
  gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
43
 
44
  with gr.Tabs(elem_classes="tab-buttons") as tabs:
45
- show_result_page(root_path='MC', title='📝 Exam', index=0)
46
- show_result_page(root_path='LLM', title='🤖 LLM as Judge', index=1)
47
- show_result_page(root_path='NLU', title='🕵️ NLU', index=2)
48
- show_result_page(root_path='NLG', title='🖊️ NLG', index=3)
 
 
 
 
 
 
 
49
  show_about_page(index=4)
50
  show_submit_page(index=5)
51
 
@@ -58,10 +75,9 @@ with demo:
58
  elem_id="citation-button",
59
  show_copy_button=True,
60
  )
61
- gr.Markdown('* Gemini result is only reported in MT-Bench because the other benchmark was mistakenly classified as unsafe')
62
-
63
 
64
  scheduler = BackgroundScheduler()
65
  scheduler.add_job(restart_space, "interval", seconds=1800)
66
  scheduler.start()
67
- demo.queue(default_concurrency_limit=40).launch()
 
16
  from src.envs import API, EVAL_REQUESTS_PATH, EVAL_RESULTS_PATH, QUEUE_REPO, REPO_ID, RESULTS_REPO, TOKEN
17
 
18
 
 
19
  def restart_space():
20
  API.restart_space(repo_id=REPO_ID)
21
 
22
+
23
  try:
24
  print(EVAL_REQUESTS_PATH)
25
  snapshot_download(
26
+ repo_id=QUEUE_REPO,
27
+ local_dir=EVAL_REQUESTS_PATH,
28
+ repo_type="dataset",
29
+ tqdm_class=None,
30
+ etag_timeout=30,
31
+ token=TOKEN,
32
  )
33
  except Exception:
34
  restart_space()
35
  try:
36
  print(EVAL_RESULTS_PATH)
37
  snapshot_download(
38
+ repo_id=RESULTS_REPO,
39
+ local_dir=EVAL_RESULTS_PATH,
40
+ repo_type="dataset",
41
+ tqdm_class=None,
42
+ etag_timeout=30,
43
+ token=TOKEN,
44
  )
45
  except Exception:
46
  restart_space()
 
52
  gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
53
 
54
  with gr.Tabs(elem_classes="tab-buttons") as tabs:
55
+ show_result_page(root_path="MC", title="📝 Exam", index=0)
56
+ show_result_page(
57
+ root_path="LLM",
58
+ title="🤖 LLM-as-a-Judge",
59
+ index=1,
60
+ extra=lambda: gr.Markdown(
61
+ "* Gemini result is only reported in MT-Bench because the other benchmark was mistakenly classified as unsafe"
62
+ ),
63
+ )
64
+ show_result_page(root_path="NLU", title="🕵️ NLU", index=2)
65
+ show_result_page(root_path="NLG", title="🖊️ NLG", index=3)
66
  show_about_page(index=4)
67
  show_submit_page(index=5)
68
 
 
75
  elem_id="citation-button",
76
  show_copy_button=True,
77
  )
78
+
 
79
 
80
  scheduler = BackgroundScheduler()
81
  scheduler.add_job(restart_space, "interval", seconds=1800)
82
  scheduler.start()
83
+ demo.queue(default_concurrency_limit=40).launch()
src/about.py CHANGED
@@ -2,8 +2,7 @@ from dataclasses import dataclass
2
  from enum import Enum
3
 
4
 
5
-
6
- NUM_FEWSHOT = 0 # Change with your few shot
7
  # ---------------------------------------------------
8
 
9
  TITLE = """<h1>🇹🇭 Thai LLM Leaderboard</h1>"""
@@ -14,7 +13,7 @@ TITLE = """<h1>🇹🇭 Thai LLM Leaderboard</h1>"""
14
  INTRODUCTION_TEXT = """
15
  The Thai-LLM Leaderboard 🇹🇭 focused on standardizing evaluation methods for large language models (LLMs) in the Thai language based on <a href="https://github.com/SEACrowd">SEACrowd</a>,
16
  As part of an open community project, we welcome you to submit new evaluation tasks or models.
17
- This leaderboard is developed in collaboration with <a href="https://www.scb10x.com">SCB 10X</a>, <a href="https://www.vistec.ac.th/">Vistec</a>, and <a href="https://github.com/SEACrowd">SEACrowd</a>.
18
  """
19
 
20
  LLM_BENCHMARKS_TEXT = f"""
@@ -23,8 +22,8 @@ The leaderboard currently consists of the following benchmarks:
23
  - Exam
24
  - <a href="https://huggingface.co/datasets/scb10x/thai_exam">ThaiExam</a>: ThaiExam is a Thai language benchmark based on examinations for high-school students and investment professionals in Thailand.
25
  - <a href="https://arxiv.org/abs/2306.05179">M3Exam</a>: M3Exam is a novel benchmark sourced from real and official human exam questions for evaluating LLMsin a multilingual, multimodal, and multilevel context. Here is Thai subset of M3Exam.
26
- - LLM as Judge
27
- - Thai MT-Bench: <a href="https://arxiv.org/abs/2306.05685">MT-Bench</a> inspired varient of LLM as judges specifically developed by Vistec for Thai language and cultural.
28
  - NLU
29
  - <a href="https://huggingface.co/datasets/facebook/belebele">Belebele</a>: Belebele is a multiple-choice machine reading comprehension (MRC) dataset spanning 122 language variants. Here is Thai subset of Belebele.
30
  - <a href="https://huggingface.co/datasets/facebook/xnli">XNLI</a>: XNLI is an evaluation corpus for language transfer and cross-lingual sentence classification in 15 languages. Here is Thai subset of XNLI.
@@ -37,9 +36,10 @@ The leaderboard currently consists of the following benchmarks:
37
 
38
 
39
  Metrics Implementations
 
40
  - BLEU is calculated using flores200 tokenizer using huggingface evaluate <a href="https://huggingface.co/spaces/evaluate-metric/sacrebleu">implementation</a>.
41
  - ROUGEL is calculated using pythainlp newmm tokenizer using huggingface evaluate <a href="https://huggingface.co/spaces/evaluate-metric/rouge">implementation</a>.
42
- - LLM as judge rating is judged by OpenAI gpt-4o-2024-05-13 using prompt specific by <a href="https://github.com/lm-sys/FastChat/blob/main/fastchat/llm_judge/data/judge_prompts.jsonl">lmsys MT-Bench</a>.
43
 
44
  Reproducibility
45
 
@@ -51,7 +51,15 @@ We're grateful to community members for task and model submitting. To contribute
51
  """
52
 
53
  CITATION_BUTTON_LABEL = "Copy the following snippet to cite these results"
54
- CITATION_BUTTON_TEXT = r"""@misc{lovenia2024seacrowdmultilingualmultimodaldata,
 
 
 
 
 
 
 
 
55
  title={SEACrowd: A Multilingual Multimodal Data Hub and Benchmark Suite for Southeast Asian Languages},
56
  author={Holy Lovenia and Rahmad Mahendra and Salsabil Maulana Akbar and Lester James V. Miranda and Jennifer Santoso and Elyanah Aco and Akhdan Fadhilah and Jonibek Mansurov and Joseph Marvin Imperial and Onno P. Kampman and Joel Ruben Antony Moniz and Muhammad Ravi Shulthan Habibi and Frederikus Hudi and Railey Montalan and Ryan Ignatius and Joanito Agili Lopo and William Nixon and Börje F. Karlsson and James Jaya and Ryandito Diandaru and Yuze Gao and Patrick Amadeus and Bin Wang and Jan Christian Blaise Cruz and Chenxi Whitehouse and Ivan Halim Parmonangan and Maria Khelli and Wenyu Zhang and Lucky Susanto and Reynard Adha Ryanda and Sonny Lazuardi Hermawan and Dan John Velasco and Muhammad Dehan Al Kautsar and Willy Fitra Hendria and Yasmin Moslem and Noah Flynn and Muhammad Farid Adilazuarda and Haochen Li and Johanes Lee and R. Damanhuri and Shuo Sun and Muhammad Reza Qorib and Amirbek Djanibekov and Wei Qi Leong and Quyet V. Do and Niklas Muennighoff and Tanrada Pansuwan and Ilham Firdausi Putra and Yan Xu and Ngee Chia Tai and Ayu Purwarianti and Sebastian Ruder and William Tjhi and Peerat Limkonchotiwat and Alham Fikri Aji and Sedrick Keh and Genta Indra Winata and Ruochen Zhang and Fajri Koto and Zheng-Xin Yong and Samuel Cahyawijaya},
57
  year={2024},
@@ -59,4 +67,4 @@ CITATION_BUTTON_TEXT = r"""@misc{lovenia2024seacrowdmultilingualmultimodaldata,
59
  archivePrefix={arXiv},
60
  primaryClass={cs.CL},
61
  url={https://arxiv.org/abs/2406.10118},
62
- }"""
 
2
  from enum import Enum
3
 
4
 
5
+ NUM_FEWSHOT = 0 # Change with your few shot
 
6
  # ---------------------------------------------------
7
 
8
  TITLE = """<h1>🇹🇭 Thai LLM Leaderboard</h1>"""
 
13
  INTRODUCTION_TEXT = """
14
  The Thai-LLM Leaderboard 🇹🇭 focused on standardizing evaluation methods for large language models (LLMs) in the Thai language based on <a href="https://github.com/SEACrowd">SEACrowd</a>,
15
  As part of an open community project, we welcome you to submit new evaluation tasks or models.
16
+ This leaderboard is developed in collaboration with <a href="https://www.scb10x.com">SCB 10X</a>, <a href="https://www.vistec.ac.th/">Vistec</a>, and <a href="https://github.com/SEACrowd">SEACrowd</a>. Read more on <a href="https://blog.opentyphoon.ai/introducing-the-thaillm-leaderboard-thaillm-evaluation-ecosystem-508e789d06bf">Introduction Blog</a>
17
  """
18
 
19
  LLM_BENCHMARKS_TEXT = f"""
 
22
  - Exam
23
  - <a href="https://huggingface.co/datasets/scb10x/thai_exam">ThaiExam</a>: ThaiExam is a Thai language benchmark based on examinations for high-school students and investment professionals in Thailand.
24
  - <a href="https://arxiv.org/abs/2306.05179">M3Exam</a>: M3Exam is a novel benchmark sourced from real and official human exam questions for evaluating LLMsin a multilingual, multimodal, and multilevel context. Here is Thai subset of M3Exam.
25
+ - LLM-as-a-Judge
26
+ - <a href="https://huggingface.co/datasets/ThaiLLM-Leaderboard/mt-bench-thai">Thai MT-Bench</a>: <a href="https://arxiv.org/abs/2306.05685">MT-Bench</a> inspired varient of LLM-as-a-Judge specifically developed by Vistec for Thai language and cultural.
27
  - NLU
28
  - <a href="https://huggingface.co/datasets/facebook/belebele">Belebele</a>: Belebele is a multiple-choice machine reading comprehension (MRC) dataset spanning 122 language variants. Here is Thai subset of Belebele.
29
  - <a href="https://huggingface.co/datasets/facebook/xnli">XNLI</a>: XNLI is an evaluation corpus for language transfer and cross-lingual sentence classification in 15 languages. Here is Thai subset of XNLI.
 
36
 
37
 
38
  Metrics Implementations
39
+ - Multiple-choice accuracy is calculated using the <a href="https://github.com/SEACrowd/seacrowd-experiments/blob/048536fc0d4614734d479b298ea00a1f520da42b/evaluation/main_nlu_prompt_batch.py#L71">SEACrowd implementation</a> of logits comparison, similar to the method used by the <a href="https://huggingface.co/spaces/open-llm-leaderboard/open_llm_leaderboard">Open LLM Leaderboard</a> (<a href="https://github.com/EleutherAI/lm-evaluation-harness">EleutherAI Harness</a>). <a href="https://huggingface.co/blog/open-llm-leaderboard-mmlu">explain</a>
40
  - BLEU is calculated using flores200 tokenizer using huggingface evaluate <a href="https://huggingface.co/spaces/evaluate-metric/sacrebleu">implementation</a>.
41
  - ROUGEL is calculated using pythainlp newmm tokenizer using huggingface evaluate <a href="https://huggingface.co/spaces/evaluate-metric/rouge">implementation</a>.
42
+ - LLM-as-a-Judge rating is judged by OpenAI gpt-4o-2024-05-13 using prompt specific by <a href="https://github.com/lm-sys/FastChat/blob/main/fastchat/llm_judge/data/judge_prompts.jsonl">lmsys MT-Bench</a>.
43
 
44
  Reproducibility
45
 
 
51
  """
52
 
53
  CITATION_BUTTON_LABEL = "Copy the following snippet to cite these results"
54
+ CITATION_BUTTON_TEXT = r"""@misc{thaillm-leaderboard,
55
+ author = {SCB 10X and Vistec and SEACrowd},
56
+ title = {Thai LLM Leaderboard},
57
+ year = {2024},
58
+ publisher = {Hugging Face},
59
+ howpublished = "\url{https://huggingface.co/spaces/ThaiLLM-Leaderboard/leaderboard}",
60
+ }
61
+
62
+ @misc{lovenia2024seacrowdmultilingualmultimodaldata,
63
  title={SEACrowd: A Multilingual Multimodal Data Hub and Benchmark Suite for Southeast Asian Languages},
64
  author={Holy Lovenia and Rahmad Mahendra and Salsabil Maulana Akbar and Lester James V. Miranda and Jennifer Santoso and Elyanah Aco and Akhdan Fadhilah and Jonibek Mansurov and Joseph Marvin Imperial and Onno P. Kampman and Joel Ruben Antony Moniz and Muhammad Ravi Shulthan Habibi and Frederikus Hudi and Railey Montalan and Ryan Ignatius and Joanito Agili Lopo and William Nixon and Börje F. Karlsson and James Jaya and Ryandito Diandaru and Yuze Gao and Patrick Amadeus and Bin Wang and Jan Christian Blaise Cruz and Chenxi Whitehouse and Ivan Halim Parmonangan and Maria Khelli and Wenyu Zhang and Lucky Susanto and Reynard Adha Ryanda and Sonny Lazuardi Hermawan and Dan John Velasco and Muhammad Dehan Al Kautsar and Willy Fitra Hendria and Yasmin Moslem and Noah Flynn and Muhammad Farid Adilazuarda and Haochen Li and Johanes Lee and R. Damanhuri and Shuo Sun and Muhammad Reza Qorib and Amirbek Djanibekov and Wei Qi Leong and Quyet V. Do and Niklas Muennighoff and Tanrada Pansuwan and Ilham Firdausi Putra and Yan Xu and Ngee Chia Tai and Ayu Purwarianti and Sebastian Ruder and William Tjhi and Peerat Limkonchotiwat and Alham Fikri Aji and Sedrick Keh and Genta Indra Winata and Ruochen Zhang and Fajri Koto and Zheng-Xin Yong and Samuel Cahyawijaya},
65
  year={2024},
 
67
  archivePrefix={arXiv},
68
  primaryClass={cs.CL},
69
  url={https://arxiv.org/abs/2406.10118},
70
+ }"""
src/pages/result_table.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import gradio as gr
2
  from gradio_leaderboard import Leaderboard, SearchColumns, SelectColumns, ColumnFilter
3
  from src.leaderboard.read_evals import FILTERED_ONLY_FIELD
@@ -8,11 +9,12 @@ from src.display.utils import (
8
  fields,
9
  )
10
 
11
- def show_result_page(root_path: str, title: str, index: int):
 
12
  raw_data, original_df = get_leaderboard_df(EVAL_RESULTS_PATH + f"/{root_path}")
13
  leaderboard_df = original_df.copy()
14
  with gr.TabItem(title, elem_id="llm-benchmark-tab-table", id=index):
15
- return Leaderboard(
16
  value=leaderboard_df,
17
  datatype=[c.type for c in fields(AutoEvalColumn)],
18
  select_columns=SelectColumns(
@@ -29,7 +31,7 @@ def show_result_page(root_path: str, title: str, index: int):
29
  ),
30
  filter_columns=[
31
  ColumnFilter(
32
- 'params',
33
  type="slider",
34
  min=0.01,
35
  max=150,
@@ -39,3 +41,7 @@ def show_result_page(root_path: str, title: str, index: int):
39
  bool_checkboxgroup_label="Hide models",
40
  interactive=False,
41
  )
 
 
 
 
 
1
+ from typing import Callable
2
  import gradio as gr
3
  from gradio_leaderboard import Leaderboard, SearchColumns, SelectColumns, ColumnFilter
4
  from src.leaderboard.read_evals import FILTERED_ONLY_FIELD
 
9
  fields,
10
  )
11
 
12
+
13
+ def show_result_page(root_path: str, title: str, index: int, extra: Callable[[None], None] = None):
14
  raw_data, original_df = get_leaderboard_df(EVAL_RESULTS_PATH + f"/{root_path}")
15
  leaderboard_df = original_df.copy()
16
  with gr.TabItem(title, elem_id="llm-benchmark-tab-table", id=index):
17
+ Leaderboard(
18
  value=leaderboard_df,
19
  datatype=[c.type for c in fields(AutoEvalColumn)],
20
  select_columns=SelectColumns(
 
31
  ),
32
  filter_columns=[
33
  ColumnFilter(
34
+ "params",
35
  type="slider",
36
  min=0.01,
37
  max=150,
 
41
  bool_checkboxgroup_label="Hide models",
42
  interactive=False,
43
  )
44
+ if extra is not None:
45
+ with gr.Column():
46
+ extra()
47
+