File size: 3,978 Bytes
bf803eb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: apache-2.0
---

# Dataset for MixEval


[MixEval](https://github.com/Psycoy/MixEval/) is a A dynamic benchmark evaluating LLMs using real-world user queries and benchmarks, achieving a 0.96 model ranking correlation with Chatbot Arena and costs around $0.6 to run using GPT-3.5 as a Judge.

You can find more information and access the MixEval leaderboard [here](https://mixeval.github.io/#leaderboard).

This is a fork of the original MixEval repository. The original repository can be found [here](https://github.com/Psycoy/MixEval/). I created this fork to make the integration and use of MixEval easier during the training of new models. This Fork includes several improved feature to make usages easier and more flexible. Including:

* Evaluation of Local Models during or post trainig with `transformers` 
* Hugging Face Datasets integration to avoid the need of local files. 
* Use of Hugging Face TGI or vLLM to accelerate evaluation and making it more manageable
* Improved markdown outputs and timing for the training
* Fixed pip install for remote or CI Integration. 

## Getting started 

```bash
# Fork with more losely dependencies
pip install git+https://github.com/philschmid/MixEval --upgrade
```

_Note: If you want to evaluate models that are not included Take a look [here](https://github.com/philschmid/MixEval?tab=readme-ov-file#registering-new-models). Zephyr example [here](https://github.com/philschmid/MixEval/blob/main/mix_eval/models/zephyr_7b_beta.py)._

## Evaluation open LLMs

**Remote Hugging Face model with existing config:**

```bash
# MODEL_PARSER_API=<your openai api key
MODEL_PARSER_API=$(echo $OPENAI_API_KEY) python -m mix_eval.evaluate \
    --data_path hf://zeitgeist-ai/mixeval \
    --model_name zephyr_7b_beta \
    --benchmark mixeval_hard \
    --version 2024-06-01 \
    --batch_size 20 \
    --output_dir results \
    --api_parallel_num 20
```

**Using vLLM/TGI with hosted or local API:**

1. start you environment
```bash
python -m vllm.entrypoints.openai.api_server --model alignment-handbook/zephyr-7b-dpo-full
```

2. run the following command

```bash
MODEL_PARSER_API=$(echo $OPENAI_API_KEY) API_URL=http://localhost:8000/v1 python -m mix_eval.evaluate \
    --data_path hf://zeitgeist-ai/mixeval \
    --model_name local_api \
    --model_path alignment-handbook/zephyr-7b-dpo-full \
    --benchmark mixeval_hard \
    --version 2024-06-01 \
    --batch_size 20 \
    --output_dir results \
    --api_parallel_num 20
```

3. Results
```bash
| Metric | Score |
|--------|-------|
| MBPP | 100.00% |
| OpenBookQA | 62.50% |
| DROP | 47.60% |
| BBH | 43.10% |
| MATH | 38.10% |
| PIQA | 37.50% |
| TriviaQA | 37.30% |
| BoolQ | 35.10% |
| CommonsenseQA | 34.00% |
| GSM8k | 33.60% |
| MMLU | 29.00% |
| HellaSwag | 27.90% |
| AGIEval | 26.80% |
| GPQA | 0.00% |
| ARC | 0.00% |
| SIQA | 0.00% |
| overall score (final score) | 34.85% |

Total time: 398.0534451007843
```

Takes around 5 minutes to evaluate.

**Local Hugging Face model from path:**

```bash
# MODEL_PARSER_API=<your openai api key>
MODEL_PARSER_API=$(echo $OPENAI_API_KEY) python -m mix_eval.evaluate \
    --data_path hf://zeitgeist-ai/mixeval \
    --model_path my/local/path \
    --output_dir results/agi-5 \
    --model_name local_chat \
    --benchmark mixeval_hard \
    --version 2024-06-01 \
    --batch_size 20 \
    --api_parallel_num 20
```

**Remote Hugging Face model without config and defaults**

_Note: We use the model name `local_chat` to avoid the need for a config file and load it from the Hugging Face model hub._

```bash
# MODEL_PARSER_API=<your openai api key>
MODEL_PARSER_API=$(echo $OPENAI_API_KEY) python -m mix_eval.evaluate \
    --data_path hf://zeitgeist-ai/mixeval \
    --model_path alignment-handbook/zephyr-7b-sft-full \
    --output_dir results/handbook-zephyr \
    --model_name local_chat \
    --benchmark mixeval_hard \
    --version 2024-06-01 \
    --batch_size 20 \
    --api_parallel_num 20
```