Skip to content

Commit 7037815

Browse files
committed
fix tests part 1 - also removes fewshot truncation in the task name because it's no longer used anywhere in the code logically
1 parent fbebba7 commit 7037815

66 files changed

Lines changed: 2359 additions & 2394 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Here’s a quick command to evaluate using the Accelerate backend:
9090
```shell
9191
lighteval accelerate \
9292
"model_name=gpt2" \
93-
"leaderboard|truthfulqa:mc|0|0"
93+
"leaderboard|truthfulqa:mc|0"
9494
```
9595

9696
## 🙏 Acknowledgements

community_tasks/custom_task_classification_grammar_task.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
Example usage:
3333
TGI endpoint evaluation:
3434
```bash
35-
uv run --active --extra litellm --extra tgi lighteval endpoint tgi examples/model_configs/tgi_model.yaml "custom|emotion_classification|0|0"
35+
uv run --active --extra litellm --extra tgi lighteval endpoint tgi examples/model_configs/tgi_model.yaml "custom|emotion_classification|0"
3636
--custom-tasks examples/custom_tasks_templates/custom_task_classification_grammar_task.py
3737
--output-dir results
3838
--save-details
@@ -449,8 +449,8 @@ def get_emotion_classification_grammar() -> TextGenerationInputGrammarType:
449449

450450
print("\nUsage Examples:")
451451
print(
452-
f" TGI: uv run lighteval endpoint tgi config/tgi/tgi.yaml 'custom|{task.name}|0|0' --custom-tasks {__file__} --output-dir results --override-batch-size 1 --use-chat-template --save-details --no-public-run --max-samples 10"
452+
f" TGI: uv run lighteval endpoint tgi config/tgi/tgi.yaml 'custom|{task.name}|0' --custom-tasks {__file__} --output-dir results --override-batch-size 1 --use-chat-template --save-details --no-public-run --max-samples 10"
453453
)
454454
print(
455-
f" Full: uv run lighteval endpoint tgi config/tgi/tgi.yaml 'custom|{task.name}|5|1' --custom-tasks {__file__} --output-dir results --override-batch-size 1 --use-chat-template --save-details --no-public-run"
455+
f" Full: uv run lighteval endpoint tgi config/tgi/tgi.yaml 'custom|{task.name}|5' --custom-tasks {__file__} --output-dir results --override-batch-size 1 --use-chat-template --save-details --no-public-run"
456456
)

docs/source/adding-a-custom-task.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,6 @@ Once your file is created you can then run the evaluation with the following com
126126
```bash
127127
lighteval accelerate \
128128
"model_name=HuggingFaceH4/zephyr-7b-beta" \
129-
"community|{custom_task}|{fewshots}|{truncate_few_shot}" \
129+
"community|{custom_task}|{fewshots}" \
130130
--custom-tasks {path_to_your_custom_task_file}
131131
```

docs/source/evaluating-a-custom-model.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ You can evaluate your custom model using either the command line interface or th
5656
lighteval custom \
5757
"google-translate" \
5858
"examples/custom_models/google_translate_model.py" \
59-
"lighteval|wmt20:fr-de|0|0" \
59+
"lighteval|wmt20:fr-de|0" \
6060
--max-samples 10
6161
```
6262

@@ -91,7 +91,7 @@ model_config = CustomModelConfig(
9191

9292
# Create and run the pipeline
9393
pipeline = Pipeline(
94-
tasks="leaderboard|truthfulqa:mc|0|0",
94+
tasks="leaderboard|truthfulqa:mc|0",
9595
pipeline_parameters=pipeline_params,
9696
evaluation_tracker=evaluation_tracker,
9797
model_config=model_config

docs/source/quicktour.mdx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ To evaluate `GPT-2` on the Truthful QA benchmark with [🤗
2727
```bash
2828
lighteval accelerate \
2929
"model_name=openai-community/gpt2" \
30-
"leaderboard|truthfulqa:mc|0|0"
30+
"leaderboard|truthfulqa:mc|0"
3131
```
3232

3333
Here, we first choose a backend (either `accelerate`, `nanotron`, `endpoint`, or `vllm`), and then specify the model and task(s) to run.
@@ -38,12 +38,9 @@ Valid key-value pairs correspond with the backend configuration, and are detaile
3838
The syntax for the task specification might be a bit hard to grasp at first. The format is as follows:
3939

4040
```txt
41-
{suite}|{task}|{num_few_shot}|{0 for strict `num_few_shots`, or 1 to allow a truncation if context size is too small}
41+
{suite}|{task}|{num_few_shot}
4242
```
4343

44-
If the fourth value is set to 1, lighteval will check if the prompt (including the few-shot examples) is too long for the context size of the task or the model.
45-
If so, the number of few shot examples is automatically reduced.
46-
4744
Tasks have a function applied at the sample level and one at the corpus level. For example,
4845
- an exact match can be applied per sample, then averaged over the corpus to give the final score
4946
- samples can be left untouched before applying Corpus BLEU at the corpus level
@@ -52,7 +49,7 @@ etc.
5249
If the task you are looking at has a sample level function (`sample_level_fn`) which can be parametrized, you can pass parameters in the CLI.
5350
For example
5451
```txt
55-
{suite}|{task}@{parameter_name1}={value1},{parameter_name2}={value2},...|0|0
52+
{suite}|{task}@{parameter_name1}={value1}@{parameter_name2}={value2},...|0
5653
```
5754

5855
All officially supported tasks can be found at the [tasks_list](available-tasks) and in the
@@ -71,7 +68,7 @@ When specifying a path to file, it should start with `./`.
7168
lighteval accelerate \
7269
"model_name=openai-community/gpt2" \
7370
./path/to/lighteval/examples/tasks/recommended_set.txt
74-
# or, e.g., "leaderboard|truthfulqa:mc|0|0|,leaderboard|gsm8k|3|1"
71+
# or, e.g., "leaderboard|truthfulqa:mc|0,leaderboard|gsm8k|3"
7572
```
7673

7774
## Evaluate a model on one or more GPUs
@@ -90,7 +87,7 @@ You can then evaluate a model using data parallelism on 8 GPUs like follows:
9087
accelerate launch --multi_gpu --num_processes=8 -m \
9188
lighteval accelerate \
9289
"model_name=openai-community/gpt2" \
93-
"leaderboard|truthfulqa:mc|0|0"
90+
"leaderboard|truthfulqa:mc|0"
9491
```
9592

9693
Here, `--override_batch_size` defines the batch size per device, so the effective
@@ -103,7 +100,7 @@ To evaluate a model using pipeline parallelism on 2 or more GPUs, run:
103100
```bash
104101
lighteval accelerate \
105102
"model_name=openai-community/gpt2,model_parallel=True" \
106-
"leaderboard|truthfulqa:mc|0|0"
103+
"leaderboard|truthfulqa:mc|0"
107104
```
108105

109106
This will automatically use accelerate to distribute the model across the GPUs.
@@ -134,7 +131,7 @@ think tokens.
134131
```bash
135132
lighteval vllm \
136133
"model_name=mistralai/Magistral-Small-2507,dtype=float16,data_parallel_size=4" \
137-
"lighteval|aime24|0|0" \
134+
"lighteval|aime24|0" \
138135
--remove-reasoning-tags \
139136
--reasoning-tags="[('[THINK]','[/THINK]')]"
140137
```

docs/source/saving-and-reading-results.mdx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,9 @@ The detail file contains the following columns:
203203
"hash_input_tokens": "29916e7afe5cb51d",
204204
"hash_cont_tokens": "37f91ce23ef6d435"
205205
},
206-
"truncated": 2,
207-
"non_truncated": 0,
208206
"padded": 0,
209207
"non_padded": 2,
210208
"effective_few_shots": 0.0,
211-
"num_truncated_few_shots": 0
212209
}
213210
},
214211
"summary_general": {
@@ -218,11 +215,8 @@ The detail file contains the following columns:
218215
"hash_input_tokens": "ac933feb14f96d7b",
219216
"hash_cont_tokens": "9d03fb26f8da7277"
220217
},
221-
"truncated": 2,
222-
"non_truncated": 0,
223218
"padded": 0,
224219
"non_padded": 2,
225-
"num_truncated_few_shots": 0
226220
}
227221
}
228222
```

docs/source/use-inference-providers-as-backend.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Lighteval allows to use Hugging Face's Inference Providers to evaluate llms on s
1212
```bash
1313
lighteval endpoint inference-providers \
1414
"model_name=deepseek-ai/DeepSeek-R1,provider=hf-inference" \
15-
"lighteval|gsm8k|0|0"
15+
"lighteval|gsm8k|0"
1616
```
1717

1818
## Using a config file
@@ -22,7 +22,7 @@ You can use config files to define the model and the provider to use.
2222
```bash
2323
lighteval endpoint inference-providers \
2424
examples/model_configs/inference_providers.yaml \
25-
"lighteval|gsm8k|0|0"
25+
"lighteval|gsm8k|0"
2626
```
2727

2828
with the following config file:

docs/source/use-litellm-as-backend.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Documentation for available APIs and compatible endpoints can be found [here](ht
1111
```bash
1212
lighteval endpoint litellm \
1313
"provider=openai,model_name=gpt-3.5-turbo" \
14-
"lighteval|gsm8k|0|0" \
14+
"lighteval|gsm8k|0" \
1515
```
1616

1717
## Using a config file

docs/source/use-sglang-as-backend.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ To use, simply change the `model_args` to reflect the arguments you want to pass
66
```bash
77
lighteval sglang \
88
"model_name=HuggingFaceH4/zephyr-7b-beta,dtype=float16" \
9-
"leaderboard|truthfulqa:mc|0|0"
9+
"leaderboard|truthfulqa:mc|0"
1010
```
1111

1212
`sglang` is able to distribute the model across multiple GPUs using data
@@ -18,15 +18,15 @@ For example if you have 4 GPUs you can split it across using `tp_size`:
1818
```bash
1919
lighteval sglang \
2020
"model_name=HuggingFaceH4/zephyr-7b-beta,dtype=float16,tp_size=4" \
21-
"leaderboard|truthfulqa:mc|0|0"
21+
"leaderboard|truthfulqa:mc|0"
2222
```
2323

2424
Or, if your model fits on a single GPU, you can use `dp_size` to speed up the evaluation:
2525

2626
```bash
2727
lighteval sglang \
2828
"model_name=HuggingFaceH4/zephyr-7b-beta,dtype=float16,dp_size=4" \
29-
"leaderboard|truthfulqa:mc|0|0"
29+
"leaderboard|truthfulqa:mc|0"
3030
```
3131

3232
## Use a config file
@@ -37,7 +37,7 @@ An example of a config file is shown below and can be found at `examples/model_c
3737
```bash
3838
lighteval sglang \
3939
"examples/model_configs/sglang_model_config.yaml" \
40-
"leaderboard|truthfulqa:mc|0|0"
40+
"leaderboard|truthfulqa:mc|0"
4141
```
4242

4343
> [!TIP]

docs/source/use-vllm-as-backend.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ To use, simply change the `model_args` to reflect the arguments you want to pass
1010
```bash
1111
lighteval vllm \
1212
"model_name=HuggingFaceH4/zephyr-7b-beta" \
13-
"extended|ifeval|0|0"
13+
"extended|ifeval|0"
1414
```
1515

1616
`vllm` is able to distribute the model across multiple GPUs using data
@@ -22,15 +22,15 @@ For example if you have 4 GPUs you can split it across using `tensor_parallelism
2222
```bash
2323
export VLLM_WORKER_MULTIPROC_METHOD=spawn && lighteval vllm \
2424
"model_name=HuggingFaceH4/zephyr-7b-beta,tensor_parallel_size=4" \
25-
"extended|ifeval|0|0"
25+
"extended|ifeval|0"
2626
```
2727

2828
Or, if your model fits on a single GPU, you can use `data_parallelism` to speed up the evaluation:
2929

3030
```bash
3131
export VLLM_WORKER_MULTIPROC_METHOD=spawn && lighteval vllm \
3232
"model_name=HuggingFaceH4/zephyr-7b-beta,data_parallel_size=4" \
33-
"extended|ifeval|0|0"
33+
"extended|ifeval|0"
3434
```
3535

3636
## Use a config file
@@ -41,7 +41,7 @@ An example of a config file is shown below and can be found at `examples/model_c
4141
```bash
4242
lighteval vllm \
4343
"examples/model_configs/vllm_model_config.yaml" \
44-
"extended|ifeval|0|0"
44+
"extended|ifeval|0"
4545
```
4646

4747
```yaml

0 commit comments

Comments
 (0)