eduagarcia commited on
Commit
7499b46
β€’
1 Parent(s): 3449f84

Parametrize documentation

Browse files
Files changed (2) hide show
  1. src/display/about.py +42 -44
  2. src/envs.py +2 -0
src/display/about.py CHANGED
@@ -1,57 +1,64 @@
1
  from src.display.utils import ModelType
 
 
2
 
3
- TITLE = """<h1 align="center" id="space-title">πŸ€— Open LLM Leaderboard</h1>"""
4
 
5
- INTRODUCTION_TEXT = """
6
- πŸ“ The πŸ€— Open LLM Leaderboard aims to track, rank and evaluate open LLMs and chatbots.
 
 
 
 
7
 
8
  πŸ€— Submit a model for automated evaluation on the πŸ€— GPU cluster on the "Submit" page!
9
  The leaderboard's backend runs the great [Eleuther AI Language Model Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness) - read more details in the "About" page!
10
  """
11
 
 
 
 
 
 
 
 
 
 
 
12
  LLM_BENCHMARKS_TEXT = f"""
13
  # Context
 
 
14
  With the plethora of large language models (LLMs) and chatbots being released week upon week, often with grandiose claims of their performance, it can be hard to filter out the genuine progress that is being made by the open-source community and which model is the current state of the art.
15
 
16
  ## How it works
17
 
18
  πŸ“ˆ We evaluate models on 7 key benchmarks using the <a href="https://github.com/EleutherAI/lm-evaluation-harness" target="_blank"> Eleuther AI Language Model Evaluation Harness </a>, a unified framework to test generative language models on a large number of different evaluation tasks.
19
 
20
- - <a href="https://arxiv.org/abs/1803.05457" target="_blank"> AI2 Reasoning Challenge </a> (25-shot) - a set of grade-school science questions.
21
- - <a href="https://arxiv.org/abs/1905.07830" target="_blank"> HellaSwag </a> (10-shot) - a test of commonsense inference, which is easy for humans (~95%) but challenging for SOTA models.
22
- - <a href="https://arxiv.org/abs/2009.03300" target="_blank"> MMLU </a> (5-shot) - a test to measure a text model's multitask accuracy. The test covers 57 tasks including elementary mathematics, US history, computer science, law, and more.
23
- - <a href="https://arxiv.org/abs/2109.07958" target="_blank"> TruthfulQA </a> (0-shot) - a test to measure a model's propensity to reproduce falsehoods commonly found online. Note: TruthfulQA in the Harness is actually a minima a 6-shots task, as it is prepended by 6 examples systematically, even when launched using 0 for the number of few-shot examples.
24
- - <a href="https://arxiv.org/abs/1907.10641" target="_blank"> Winogrande </a> (5-shot) - an adversarial and difficult Winograd benchmark at scale, for commonsense reasoning.
25
- - <a href="https://arxiv.org/abs/2110.14168" target="_blank"> GSM8k </a> (5-shot) - diverse grade school math word problems to measure a model's ability to solve multi-step mathematical reasoning problems.
26
 
27
  For all these evaluations, a higher score is a better score.
28
  We chose these benchmarks as they test a variety of reasoning and general knowledge across a wide variety of fields in 0-shot and few-shot settings.
29
 
30
  ## Details and logs
31
  You can find:
32
- - detailed numerical results in the `results` Hugging Face dataset: https://huggingface.co/datasets/open-llm-leaderboard/results
33
  - details on the input/outputs for the models in the `details` of each model, that you can access by clicking the πŸ“„ emoji after the model name
34
- - community queries and running status in the `requests` Hugging Face dataset: https://huggingface.co/datasets/open-llm-leaderboard/requests
35
 
36
  ## Reproducibility
37
- To reproduce our results, here is the commands you can run, using [this version](https://github.com/EleutherAI/lm-evaluation-harness/tree/b281b0921b636bc36ad05c0b0b0763bd6dd43463) of the Eleuther AI Harness:
38
- `python main.py --model=hf-causal-experimental --model_args="pretrained=<your_model>,use_accelerate=True,revision=<your_model_revision>"`
39
- ` --tasks=<task_list> --num_fewshot=<n_few_shot> --batch_size=1 --output_path=<output_path>`
40
 
41
  The total batch size we get for models which fit on one A100 node is 8 (8 GPUs * 1). If you don't use parallelism, adapt your batch size to fit.
42
  *You can expect results to vary slightly for different batch sizes because of padding.*
43
 
44
  The tasks and few shots parameters are:
45
- - ARC: 25-shot, *arc-challenge* (`acc_norm`)
46
- - HellaSwag: 10-shot, *hellaswag* (`acc_norm`)
47
- - TruthfulQA: 0-shot, *truthfulqa-mc* (`mc2`)
48
- - MMLU: 5-shot, *hendrycksTest-abstract_algebra,hendrycksTest-anatomy,hendrycksTest-astronomy,hendrycksTest-business_ethics,hendrycksTest-clinical_knowledge,hendrycksTest-college_biology,hendrycksTest-college_chemistry,hendrycksTest-college_computer_science,hendrycksTest-college_mathematics,hendrycksTest-college_medicine,hendrycksTest-college_physics,hendrycksTest-computer_security,hendrycksTest-conceptual_physics,hendrycksTest-econometrics,hendrycksTest-electrical_engineering,hendrycksTest-elementary_mathematics,hendrycksTest-formal_logic,hendrycksTest-global_facts,hendrycksTest-high_school_biology,hendrycksTest-high_school_chemistry,hendrycksTest-high_school_computer_science,hendrycksTest-high_school_european_history,hendrycksTest-high_school_geography,hendrycksTest-high_school_government_and_politics,hendrycksTest-high_school_macroeconomics,hendrycksTest-high_school_mathematics,hendrycksTest-high_school_microeconomics,hendrycksTest-high_school_physics,hendrycksTest-high_school_psychology,hendrycksTest-high_school_statistics,hendrycksTest-high_school_us_history,hendrycksTest-high_school_world_history,hendrycksTest-human_aging,hendrycksTest-human_sexuality,hendrycksTest-international_law,hendrycksTest-jurisprudence,hendrycksTest-logical_fallacies,hendrycksTest-machine_learning,hendrycksTest-management,hendrycksTest-marketing,hendrycksTest-medical_genetics,hendrycksTest-miscellaneous,hendrycksTest-moral_disputes,hendrycksTest-moral_scenarios,hendrycksTest-nutrition,hendrycksTest-philosophy,hendrycksTest-prehistory,hendrycksTest-professional_accounting,hendrycksTest-professional_law,hendrycksTest-professional_medicine,hendrycksTest-professional_psychology,hendrycksTest-public_relations,hendrycksTest-security_studies,hendrycksTest-sociology,hendrycksTest-us_foreign_policy,hendrycksTest-virology,hendrycksTest-world_religions* (average of all the results `acc`)
49
- - Winogrande: 5-shot, *winogrande* (`acc`)
50
- - GSM8k: 5-shot, *gsm8k* (`acc`)
51
 
52
  Side note on the baseline scores:
53
- - for log-likelihood evaluation, we select the random baseline
54
- - for GSM8K, we select the score obtained in the paper after finetuning a 6B model on the full GSM8K training set for 50 epochs
55
 
56
  ## Icons
57
  - {ModelType.PT.to_str(" : ")} model: new, base models, trained on a given corpora
@@ -70,10 +77,10 @@ To get more information about quantization, see:
70
 
71
  ## Useful links
72
  - [Community resources](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard/discussions/174)
73
- - [Collection of best models](https://huggingface.co/collections/open-llm-leaderboard/llm-leaderboard-best-models-652d6c7965a4619fb5c27a03)
74
  """
75
 
76
- FAQ_TEXT = """
77
  ---------------------------
78
  # FAQ
79
  Below are some common questions - if this FAQ does not answer you, feel free to create a new issue, and we'll take care of it as soon as we can!
@@ -86,24 +93,24 @@ What about models of type X?
86
  - *We only support models that have been integrated in a stable version of the `transformers` library for automatic submission.*
87
 
88
  How can I follow when my model is launched?
89
- - *You can look for its request file [here](https://huggingface.co/datasets/open-llm-leaderboard/requests) and follow the status evolution, or directly in the queues above the submit form.*
90
 
91
  My model disappeared from all the queues, what happened?
92
- - *A model disappearing from all the queues usually means that there has been a failure. You can check if that is the case by looking for your model [here](https://huggingface.co/datasets/open-llm-leaderboard/requests).*
93
 
94
  What causes an evaluation failure?
95
  - *Most of the failures we get come from problems in the submissions (corrupted files, config problems, wrong parameters selected for eval ...), so we'll be grateful if you first make sure you have followed the steps in `About`. However, from time to time, we have failures on our side (hardware/node failures, problem with an update of our backend, connectivity problem ending up in the results not being saved, ...).*
96
 
97
  How can I report an evaluation failure?
98
- - *As we store the logs for all models, feel free to create an issue, **where you link to the requests file of your model** (look for it [here](https://huggingface.co/datasets/open-llm-leaderboard/requests/tree/main)), so we can investigate! If the model failed due to a problem on our side, we'll relaunch it right away!*
99
  *Note: Please do not re-upload your model under a different name, it will not help*
100
 
101
  ## 2) Model results
102
  What kind of information can I find?
103
  - *Let's imagine you are interested in the Yi-34B results. You have access to 3 different information categories:*
104
- - *The [request file](https://huggingface.co/datasets/open-llm-leaderboard/requests/blob/main/01-ai/Yi-34B_eval_request_False_bfloat16_Original.json): it gives you information about the status of the evaluation*
105
- - *The [aggregated results folder](https://huggingface.co/datasets/open-llm-leaderboard/results/tree/main/01-ai/Yi-34B): it gives you aggregated scores, per experimental run*
106
- - *The [details dataset](https://huggingface.co/datasets/open-llm-leaderboard/details_01-ai__Yi-34B/tree/main): it gives you the full details (scores and examples for each task and a given model)*
107
 
108
 
109
  Why do models appear several times in the leaderboard?
@@ -119,20 +126,14 @@ My model has been flagged improperly, what can I do?
119
  I upgraded my model and want to re-submit, how can I do that?
120
  - *Please open an issue with the precise name of your model, and we'll remove your model from the leaderboard so you can resubmit. You can also resubmit directly with the new commit hash!*
121
 
122
- I need to rename my model, how can I do that?
123
- - *You can use @Weyaxi 's [super cool tool](https://huggingface.co/spaces/Weyaxi/open-llm-leaderboard-renamer) to request model name changes, then open a discussion where you link to the created pull request, and we'll check them and merge them as needed.*
124
-
125
  ## 4) Other
126
- Why don't you display closed source model scores?
127
- - *This is a leaderboard for Open models, both for philosophical reasons (openness is cool) and for practical reasons: we want to ensure that the results we display are accurate and reproducible, but 1) commercial closed models can change their API thus rendering any scoring at a given time incorrect 2) we re-run everything on our cluster to ensure all models are run on the same setup and you can't do that for these models.*
128
-
129
  I have an issue about accessing the leaderboard through the Gradio API
130
  - *Since this is not the recommended way to access the leaderboard, we won't provide support for this, but you can look at tools provided by the community for inspiration!*
131
  """
132
 
133
 
134
- EVALUATION_QUEUE_TEXT = """
135
- # Evaluation Queue for the πŸ€— Open LLM Leaderboard
136
 
137
  Models added here will be automatically evaluated on the πŸ€— cluster.
138
 
@@ -147,19 +148,16 @@ tokenizer = AutoTokenizer.from_pretrained("your model name", revision=revision)
147
  ```
148
  If this step fails, follow the error messages to debug your model before submitting it. It's likely your model has been improperly uploaded.
149
 
150
- Note: make sure your model is public!
151
  Note: if your model needs `use_remote_code=True`, we do not support this option yet but we are working on adding it, stay posted!
152
 
153
  ### 2) Convert your model weights to [safetensors](https://huggingface.co/docs/safetensors/index)
154
  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`!
155
 
156
- ### 3) Make sure your model has an open license!
157
- This is a leaderboard for Open LLMs, and we'd love for as many people as possible to know they can use your model πŸ€—
158
-
159
- ### 4) Fill up your model card
160
  When we add extra information about models to the leaderboard, it will be automatically taken from the model card
161
 
162
- ### 5) Select the correct precision
163
  Not all models are converted properly from `float16` to `bfloat16`, and selecting the wrong precision can sometimes cause evaluation error (as loading a `bf16` model in `fp16` can sometimes generate NaNs, depending on the weight range).
164
 
165
  ## In case of model failure
 
1
  from src.display.utils import ModelType
2
+ from src.display.utils import Tasks
3
+ from src.envs import REPO_ID, QUEUE_REPO, RESULTS_REPO, PATH_TO_COLLECTION, LEADERBOARD_NAME
4
 
5
+ LM_EVAL_URL = "https://github.com/eduagarcia/lm-evaluation-harness-pt"
6
 
7
+ TITLE = F"""<h1 align="center" id="space-title">πŸ€— {LEADERBOARD_NAME}</h1>"""
8
+
9
+ INTRODUCTION_TEXT = f"""
10
+ πŸ“ The πŸ€— {LEADERBOARD_NAME} aims to track, rank and evaluate open LLMs and chatbots.
11
+
12
+ This is a fork of the <a href="https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard" target="_blank">πŸ€— Open LLM Leaderboard</a> with different benchmarks.
13
 
14
  πŸ€— Submit a model for automated evaluation on the πŸ€— GPU cluster on the "Submit" page!
15
  The leaderboard's backend runs the great [Eleuther AI Language Model Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness) - read more details in the "About" page!
16
  """
17
 
18
+ TASKS_LIST= ""
19
+ for task in Tasks:
20
+ task = task.value
21
+ TASKS_LIST += f'- <a href="{task.link}" target="_blank"> {task.col_name} </a> ({task.few_shot}-shot) - {task.description}\n'
22
+
23
+ TASKS_PARAMETERS = ""
24
+ for task in Tasks:
25
+ task = task.value
26
+ TASKS_PARAMETERS += f"- {task.col_name}: {task.few_shot}-shot, *{','.join(task.task_list)}* (`{task.metric}`)\n"
27
+
28
  LLM_BENCHMARKS_TEXT = f"""
29
  # Context
30
+ This is a fork of the <a href="https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard" target="_blank">πŸ€— Open LLM Leaderboard</a> with different benchmarks.
31
+
32
  With the plethora of large language models (LLMs) and chatbots being released week upon week, often with grandiose claims of their performance, it can be hard to filter out the genuine progress that is being made by the open-source community and which model is the current state of the art.
33
 
34
  ## How it works
35
 
36
  πŸ“ˆ We evaluate models on 7 key benchmarks using the <a href="https://github.com/EleutherAI/lm-evaluation-harness" target="_blank"> Eleuther AI Language Model Evaluation Harness </a>, a unified framework to test generative language models on a large number of different evaluation tasks.
37
 
38
+ {TASKS_LIST}
 
 
 
 
 
39
 
40
  For all these evaluations, a higher score is a better score.
41
  We chose these benchmarks as they test a variety of reasoning and general knowledge across a wide variety of fields in 0-shot and few-shot settings.
42
 
43
  ## Details and logs
44
  You can find:
45
+ - detailed numerical results in the `results` Hugging Face dataset: https://huggingface.co/datasets/{RESULTS_REPO}
46
  - details on the input/outputs for the models in the `details` of each model, that you can access by clicking the πŸ“„ emoji after the model name
47
+ - community queries and running status in the `requests` Hugging Face dataset: https://huggingface.co/datasets/{QUEUE_REPO}
48
 
49
  ## Reproducibility
50
+ To reproduce our results, here is the commands you can run, using [this fork]({LM_EVAL_URL}) of the Eleuther AI Harness:
51
+ `lm_eval --model=huggingface --model_args="pretrained=<your_model>,revision=<your_model_revision>"`
52
+ ` --tasks=<task_list> --num_fewshot=<n_few_shot> --batch_size=1 --output_path=<output_path> --log_samples --show_config`
53
 
54
  The total batch size we get for models which fit on one A100 node is 8 (8 GPUs * 1). If you don't use parallelism, adapt your batch size to fit.
55
  *You can expect results to vary slightly for different batch sizes because of padding.*
56
 
57
  The tasks and few shots parameters are:
58
+ {TASKS_PARAMETERS}
 
 
 
 
 
59
 
60
  Side note on the baseline scores:
61
+ - The baseline is the random model mean result for the task
 
62
 
63
  ## Icons
64
  - {ModelType.PT.to_str(" : ")} model: new, base models, trained on a given corpora
 
77
 
78
  ## Useful links
79
  - [Community resources](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard/discussions/174)
80
+ - [Collection of best models](https://huggingface.co/collections/{PATH_TO_COLLECTION})
81
  """
82
 
83
+ FAQ_TEXT = f"""
84
  ---------------------------
85
  # FAQ
86
  Below are some common questions - if this FAQ does not answer you, feel free to create a new issue, and we'll take care of it as soon as we can!
 
93
  - *We only support models that have been integrated in a stable version of the `transformers` library for automatic submission.*
94
 
95
  How can I follow when my model is launched?
96
+ - *You can look for its request file [here](https://huggingface.co/datasets/{QUEUE_REPO}) and follow the status evolution, or directly in the queues above the submit form.*
97
 
98
  My model disappeared from all the queues, what happened?
99
+ - *A model disappearing from all the queues usually means that there has been a failure. You can check if that is the case by looking for your model [here](https://huggingface.co/datasets/{QUEUE_REPO}).*
100
 
101
  What causes an evaluation failure?
102
  - *Most of the failures we get come from problems in the submissions (corrupted files, config problems, wrong parameters selected for eval ...), so we'll be grateful if you first make sure you have followed the steps in `About`. However, from time to time, we have failures on our side (hardware/node failures, problem with an update of our backend, connectivity problem ending up in the results not being saved, ...).*
103
 
104
  How can I report an evaluation failure?
105
+ - *As we store the logs for all models, feel free to create an issue, **where you link to the requests file of your model** (look for it [here](https://huggingface.co/datasets/{QUEUE_REPO}/tree/main)), so we can investigate! If the model failed due to a problem on our side, we'll relaunch it right away!*
106
  *Note: Please do not re-upload your model under a different name, it will not help*
107
 
108
  ## 2) Model results
109
  What kind of information can I find?
110
  - *Let's imagine you are interested in the Yi-34B results. You have access to 3 different information categories:*
111
+ - *The [request file](https://huggingface.co/datasets/{QUEUE_REPO}/blob/main/01-ai/Yi-34B_eval_request_False_bfloat16_Original.json): it gives you information about the status of the evaluation*
112
+ - *The [aggregated results folder](https://huggingface.co/datasets/{RESULTS_REPO}/tree/main/01-ai/Yi-34B): it gives you aggregated scores, per experimental run*
113
+ - *The [details dataset](https://huggingface.co/datasets/{RESULTS_REPO}/tree/main/01-ai/Yi-34B): it gives you the full details (scores and examples for each task and a given model)*
114
 
115
 
116
  Why do models appear several times in the leaderboard?
 
126
  I upgraded my model and want to re-submit, how can I do that?
127
  - *Please open an issue with the precise name of your model, and we'll remove your model from the leaderboard so you can resubmit. You can also resubmit directly with the new commit hash!*
128
 
 
 
 
129
  ## 4) Other
 
 
 
130
  I have an issue about accessing the leaderboard through the Gradio API
131
  - *Since this is not the recommended way to access the leaderboard, we won't provide support for this, but you can look at tools provided by the community for inspiration!*
132
  """
133
 
134
 
135
+ EVALUATION_QUEUE_TEXT = f"""
136
+ # Evaluation Queue for the πŸ€— {LEADERBOARD_NAME}
137
 
138
  Models added here will be automatically evaluated on the πŸ€— cluster.
139
 
 
148
  ```
149
  If this step fails, follow the error messages to debug your model before submitting it. It's likely your model has been improperly uploaded.
150
 
151
+ Note: make sure your model is public!
152
  Note: if your model needs `use_remote_code=True`, we do not support this option yet but we are working on adding it, stay posted!
153
 
154
  ### 2) Convert your model weights to [safetensors](https://huggingface.co/docs/safetensors/index)
155
  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`!
156
 
157
+ ### 3) Fill up your model card
 
 
 
158
  When we add extra information about models to the leaderboard, it will be automatically taken from the model card
159
 
160
+ ### 4) Select the correct precision
161
  Not all models are converted properly from `float16` to `bfloat16`, and selecting the wrong precision can sometimes cause evaluation error (as loading a `bf16` model in `fp16` can sometimes generate NaNs, depending on the weight range).
162
 
163
  ## In case of model failure
src/envs.py CHANGED
@@ -5,6 +5,8 @@ from huggingface_hub import HfApi
5
  # clone / pull the lmeh eval data
6
  H4_TOKEN = os.environ.get("H4_TOKEN", None)
7
 
 
 
8
  REPO_ID = os.getenv("REPO_ID", "HuggingFaceH4/open_llm_leaderboard")
9
  QUEUE_REPO = os.getenv("QUEUE_REPO", "open-llm-leaderboard/requests")
10
  DYNAMIC_INFO_REPO = os.getenv("DYNAMIC_INFO_REPO", "open-llm-leaderboard/dynamic_model_information")
 
5
  # clone / pull the lmeh eval data
6
  H4_TOKEN = os.environ.get("H4_TOKEN", None)
7
 
8
+ LEADERBOARD_NAME = os.getenv("LEADERBOARD_NAME", "Open LLM Leaderboard")
9
+
10
  REPO_ID = os.getenv("REPO_ID", "HuggingFaceH4/open_llm_leaderboard")
11
  QUEUE_REPO = os.getenv("QUEUE_REPO", "open-llm-leaderboard/requests")
12
  DYNAMIC_INFO_REPO = os.getenv("DYNAMIC_INFO_REPO", "open-llm-leaderboard/dynamic_model_information")