You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/adding-a-new-metric.mdx
+18-2Lines changed: 18 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,25 @@
1
1
# Adding a New Metric
2
2
3
-
Lighteval provides a flexible system for creating custom metrics to evaluate model performance. This guide explains how to create and integrate new metrics into the evaluation framework.
Copy file name to clipboardExpand all lines: docs/source/available-tasks.mdx
-2Lines changed: 0 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,5 @@
1
1
# Available Tasks
2
2
3
-
Lighteval provides a comprehensive collection of evaluation tasks covering various aspects of language model capabilities. You can explore and use these tasks to evaluate your models across different domains and skills.
Lighteval supports multilingual evaluations through a comprehensive system of translation literals and language-adapted templates. This guide explains how to contribute translations and create new multilingual tasks.
3
+
Lighteval supports multilingual evaluations through a comprehensive system of translation literals and language-adapted templates.
Used for standard multiple choice questions where the model selects from lettered options:
86
+
```python
87
+
MCFFormulation()
88
+
```
89
+
90
+
**Example output:**
91
+
```
92
+
Question: What is the capital of France?
93
+
A. London
94
+
B. Paris
95
+
C. Berlin
96
+
D. Rome
97
+
Answer: | A/B/C/D
98
+
```
99
+
100
+
##### Classification Formulation (CF)
101
+
Used for classification tasks where the model generates the answer directly:
102
+
```python
103
+
CFFormulation()
104
+
```
105
+
106
+
**Example output:**
107
+
```
108
+
Question: What is the capital of France?
109
+
Answer: | Paris
110
+
```
111
+
112
+
##### Hybrid Formulation
113
+
Used for tasks that present choices but expect the full answer text:
114
+
```python
115
+
HybridFormulation()
116
+
```
117
+
118
+
**Example output:**
119
+
```
120
+
Question: What is the capital of France?
121
+
A. London
122
+
B. Paris
123
+
C. Berlin
124
+
D. Rome
125
+
Answer: | Paris
126
+
```
127
+
128
+
90
129
### Creating Your Multilingual Task
91
130
92
131
#### Step 1: Create the Task File
@@ -158,102 +197,15 @@ Follow the custom task guide to test if your task is correctly implemented.
158
197
> [!TIP]
159
198
> All [`~tasks.lighteval_task.LightevalTaskConfig`] parameters are strongly typed, including the inputs to the template function. Make sure to take advantage of your IDE's functionality to make it easier to correctly fill these parameters.
160
199
161
-
### Formulation Types
162
-
163
-
#### Multiple Choice Formulation (MCF)
164
-
Used for standard multiple choice questions:
165
-
```python
166
-
MCFFormulation()
167
-
```
168
-
169
-
#### Classification Formulation (CF)
170
-
Used for classification tasks:
171
-
```python
172
-
CFFormulation()
173
-
```
174
-
175
-
#### Hybrid Formulation
176
-
Used for tasks that combine multiple approaches:
177
-
```python
178
-
HybridFormulation()
179
-
```
180
-
181
-
### Language Support
182
-
183
-
Currently supported languages include:
184
-
-**English** (ENGLISH)
185
-
-**Spanish** (SPANISH)
186
-
-**French** (FRENCH)
187
-
-**German** (GERMAN)
188
-
-**Italian** (ITALIAN)
189
-
-**Portuguese** (PORTUGUESE)
190
-
-**Russian** (RUSSIAN)
191
-
-**Chinese** (CHINESE)
192
-
-**Japanese** (JAPANESE)
193
-
-**Korean** (KOREAN)
194
-
-**Arabic** (ARABIC)
195
-
-**Hindi** (HINDI)
196
-
-**Turkish** (TURKISH)
197
-
-**Dutch** (DUTCH)
198
-
-**Polish** (POLISH)
199
-
-**Swedish** (SWEDISH)
200
-
-**Norwegian** (NORWEGIAN)
201
-
-**Danish** (DANISH)
202
-
-**Finnish** (FINNISH)
203
-
204
-
### Best Practices
205
-
206
-
#### Translation Literals
207
-
-**Test your translations** with native speakers
208
-
-**Consider regional variations** in language usage
209
-
-**Maintain consistency** with existing translations
210
-
-**Document any special considerations** in your PR
211
-
212
-
#### Multilingual Tasks
213
-
-**Choose appropriate templates** for your task type
214
-
-**Test across multiple languages** to ensure consistency
215
-
-**Consider cultural differences** in task interpretation
216
-
-**Validate dataset quality** for each language
217
-
-**Use appropriate metrics** for your task formulation
218
-
219
-
#### Code Quality
220
-
-**Follow existing code style** and conventions
221
-
-**Add comprehensive documentation** for your task
222
-
-**Include example usage** in your PR description
223
-
-**Test thoroughly** before submitting
224
-
225
-
### Testing Your Contribution
226
-
227
-
#### Local Testing
228
-
```bash
229
-
# Test your task locally
230
-
lighteval accelerate \
231
-
"model_name=openai-community/gpt2" \
232
-
"community|your_task_name|0|0" \
233
-
--max-samples 10
234
-
```
235
-
236
-
#### Validation Checklist
200
+
### Validation Checklist
237
201
-[ ] Translation literals are accurate and complete
238
202
-[ ] Task works correctly across all target languages
239
203
-[ ] Metrics are appropriate for the task type
240
204
-[ ] Documentation is clear and comprehensive
241
205
-[ ] Code follows project conventions
242
206
243
-
### Submitting Your Contribution
244
-
245
-
1.**Create a feature branch** for your changes
246
-
2.**Add comprehensive tests** for your task
247
-
3.**Update documentation** as needed
248
-
4.**Open a pull request** with a clear description
249
-
5.**Respond to review feedback** promptly
250
-
251
-
Once everything is good, open a PR, and we'll be happy to review it!
252
-
253
207
### Getting Help
254
208
255
209
-**GitHub Issues**: Report bugs or ask questions
256
210
-**Discussions**: Join community discussions
257
211
-**Documentation**: Review existing guides and examples
258
-
259
-
For more detailed information about multilingual evaluations, see the [Multilingual Tasks Reference](package_reference/tasks).
-`vllm`: Evaluate models on one or more GPUs using [🚀
17
+
VLLM](https://github.com/vllm-project/vllm)
18
+
-`custom`: Evaluate custom models (can be anything)
19
+
-`sglang`: Evaluate models using [SGLang](https://github.com/sgl-project/sglang) as backend
20
+
-`inference-endpoint`: Evaluate models using Hugging Face's [Inference Endpoints API](https://huggingface.co/inference-endpoints/dedicated)
21
+
-`tgi`: Evaluate models using [🔗 Text Generation Inference](https://huggingface.co/docs/text-generation-inference/en/index) running locally
22
+
-`litellm`: Evaluate models on any compatible API using [LiteLLM](https://www.litellm.ai/)
23
+
-`inference-providers`: Evaluate models using [HuggingFace's inference providers](https://huggingface.co/docs/inference-providers/en/index) as backend**: Distributed training and evaluation
Copy file name to clipboardExpand all lines: docs/source/use-inference-providers-as-backend.mdx
-23Lines changed: 0 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,29 +47,6 @@ Optionally, you can charge them to an organization by setting `org_to_bill="<you
47
47
Hugging Face Inference Providers supports a wide range of LLM providers see the [Inference Providers documentation](https://huggingface.co/docs/inference-providers/en/index) for the complete list.
48
48
49
49
50
-
## Key Parameters
51
-
52
-
### Provider Configuration
53
-
- `model_name`: The Hugging Face model ID to use
54
-
- `provider`: The inference provider (together, fireworks, novita, etc.)
55
-
- `timeout`: Request timeout in seconds (null for default)
56
-
- `proxies`: Proxy configuration (null for default)
57
-
- `parallel_calls_count`: Number of parallel API calls (default: 10)
58
-
- `org_to_bill`: Organization name for billing (optional)
0 commit comments