File size: 7,368 Bytes
efeee6d 314f91a c7e2754 95f85ed efeee6d 314f91a b899767 efeee6d 943f952 aa6880d 157c503 aa6880d 1ffc326 b899767 efeee6d c7e2754 804f4a9 c7e2754 854db9a 58733e4 efeee6d 8c49cb6 75a13cb 0aced5f 37e3c44 75a13cb 37e3c44 f97bde5 0227006 efeee6d 0227006 34b4f04 b821ed7 f97bde5 3590807 b821ed7 f97bde5 34b4f04 3590807 3a5b349 3590807 34b4f04 f97bde5 3a5b349 3590807 f97bde5 3590807 b5c5474 34b4f04 f97bde5 d313dbd 8c49cb6 0aced5f 5db1e00 34b4f04 5db1e00 0aced5f d313dbd dfe585c d313dbd dfe585c d313dbd 8c49cb6 b323764 d313dbd 34b4f04 d313dbd b323764 34b4f04 d313dbd 34b4f04 d313dbd 8c49cb6 0aced5f 58733e4 2a73469 217b585 9833cdb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
from dataclasses import dataclass
from enum import Enum
from src.envs import REPO_ID
@dataclass
class Task:
benchmark: str
metric: str
col_name: str
# Select your tasks here
# ---------------------------------------------------
class Tasks(Enum):
# task_key in the json file, metric_key in the json file, name to display in the leaderboard
task1 = Task("PeKA", "acc", "PeKA*")
task2 = Task("PersBETS", "acc", "PersBETS*")
task3 = Task("khayyam_challenge", "acc", "Khayyam Challenge")
task4 = Task("parsinlu_mc", "acc", "ParsiNLU MCQA")
task5 = Task("parsinlu_nli", "acc", "ParsiNLU NLI")
task6 = Task("parsinlu_qqp", "acc", "ParsiNLU QQP")
# task7 = Task("persian_ARC", "acc", "Persian ARC")
NUM_FEWSHOT = 0 # Change with your few shot
# ---------------------------------------------------
# Your leaderboard name
TITLE = f"""
<img src="https://huggingface.co/spaces/{REPO_ID}/resolve/main/banner_green.png" style="width:70%;display:block;margin-left:auto;margin-right:auto">
"""
# What does your leaderboard evaluate?
INTRODUCTION_TEXT = """
Persian LLM Leaderboard is designed to be a challenging benchmark and provide a reliable evaluation of LLMs in Persian Language.
Note: This is a demo version of the leaderboard. Two new benchmarks are introduced: *PeKA* and *PersBETS*, challenging the native knowledge of the models along with
linguistic skills and their level of bias, ethics, and trustworthiness. **These datasets are not yet public, but they will be uploaded onto huggingface along with a detailed paper
explaining the data and performance of relevent models.**
Note: **We plan to release an evaluation framework soon in which the details and methods of evaluation are specified.**
Note: The two closed benchmarks are supposed to change drastically in the next two weeks, so this leaderboard's numeric values may need modifications once the framework and the corresponding data are made open.
"""
# Which evaluations are you running? how can people reproduce what you have?
LLM_BENCHMARKS_TEXT = f"""
## ABOUT
For now, the only competitive open language models capable of properly speaking Persian are the multilingual ones, Meta's Llama 3.1 being the prime example.
There are only a few capable multilingual LLMs in Persian that derive their main knowledge from English. A Persian LLM is almost an imagination right now as there doesn't exist
that many models being expert in Persian in the first place.
Our goal is to provide a benchmark on diverse domains and tasks that provide insights on how much is the gap between current Persian LLMs and the SOTA multilingual models right now in different grounds.
This benchmark can also be used by multilingual researchers to measure how well their model performs in a language like Persian.
We use our own framework to evaluate the models on the following benchmarks (TO BE RELEASED SOON).
### Tasks
- PeKA: Persian Knowledge Assesment (0-shot) - a set of multiple-choice questions that tests the level of native knowledge in Persian language in more 15 domains and categories: From art to history and geography, cinema, tv, sports, law and medicine, and much more.
- PersBETS: Persian Bias Ethics Toxicity and Skills (0-shot) - a test of model's capability in linguistic skills such as Grammar and Praphrasing, and also questions examining the bias, ethics, and toxicity of the model.
- <a href="https://arxiv.org/abs/2404.06644" target="_blank"> Khayyam Challenge (Persian MMLU) </a> (0-shot) - comprising 20,805 four-choice questions (of which we use 20,776, removing questions that are longer than 200 words) sourced from 38 diverse tasks extracted from Persian examinations, spanning a wide spectrum of subjects, complexities, and ages
- <a href="https://arxiv.org/abs/2012.06154" target="_blank"> ParsiNLU MCQA </a> (0-shot) - a series of multiple-choice questions in domains of *literature*, *math & logic*, and *common knowledge*.
- <a href="https://arxiv.org/abs/2012.06154" target="_blank"> ParsiNLU NLI </a> (max[0,3,5,10]-shot) - a 3-way classification to determine whether a hypothesis sentence entails, contradicts, or is neutral with respect to a given premise sentence.
- <a href="https://arxiv.org/abs/2012.06154" target="_blank"> ParsiNLU QQP </a> (max[0,2,5,10]-shot) - task of deciding whether a whether two given questions are paraphrases of each other or not.
For all these evaluations, a higher score is a better score.
We use the given *test* subset (for thsoe who also have *train* and *dev* subsets) for all these evaluations.
We chose these benchmarks for now, but several other benchmarks are going to be added later to help us perform a more thorough examination of models.
The last two benchmarks, ParsiNLU NLI and ParsiNLU QQP are evaluated in different few-shot settings and then the maximum score is returned as the final evaluation.
We argue that this is indeed a fair evaluation scheme since many light-weight models (around ~7B and less) can have a poor in-context learning and thus perform better
in small shots (or have a small knowledge capacity and perform poorly in zero-shot). We wish to not hold this against the model by trying to measure performances in different settings and take the maximum score achieved .
## REPRODUCIBILITY
The parameters used for evaluation along with instructions and prompts will be available once the framework is release. (TO BE COMPLETED)
"""
EVALUATION_QUEUE_TEXT = """
## Important Notes
- Right now, the models added **are not automatically evaluated**. - We may support automatic evaluation in the future on our own clusters.
- An evaluation framework will be available in the future to help everyone reproduce the results.
- We only support models with **a causal language modeling head** for now.
## Don't forget to read the FAQ and the About tabs for more information!
## First steps before submitting a model
### 1) Make sure you can load your model and tokenizer using AutoClasses:
```python
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer
config = AutoConfig.from_pretrained("your model name", revision=revision)
model = AutoModelForCausalLM.from_pretrained("your model name", revision=revision)
tokenizer = AutoTokenizer.from_pretrained("your model name", revision=revision)
```
If this step fails, follow the error messages to debug your model before submitting it. It's likely your model has been improperly uploaded.
Note: make sure your model is public!
### 2) Make sure your model has an open license!
This is a leaderboard for Open LLMs, and we'd love for as many people as possible to know they can use your model 🤗
### 3) Fill up your model card
When we add extra information about models to the leaderboard, it will be automatically taken from the model card
### 4) Select the correct precision
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).
## In case of model failure
If your model is displayed in the `FAILED` category, its execution stopped.
Make sure you have followed the above steps first.
"""
CITATION_BUTTON_LABEL = "Copy the following snippet to cite these results"
CITATION_BUTTON_TEXT = r"""
"""
|