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
Adds template for custom path saving results (#755)
## Pull Request Overview
This PR adds support for using a custom template to determine where evaluation results are saved. The changes include adding a new parameter "results_path_template" across multiple main modules and updating the EvaluationTracker to honor this template for saving results; the associated tests and documentation have been updated accordingly.
- Added a new test for the custom results template.
- Extended CLI options in several main modules to accept "results_path_template".
- Updated EvaluationTracker logic and documentation to reflect the new functionality.
---------
Co-authored-by: Copilot <[email protected]>
Copy file name to clipboardExpand all lines: src/lighteval/main_accelerate.py
+8-3Lines changed: 8 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -60,9 +60,6 @@ def accelerate( # noqa C901
60
60
custom_tasks: Annotated[
61
61
Optional[str], Option(help="Path to custom tasks directory.", rich_help_panel=HELP_PANEL_NAME_1)
62
62
] =None,
63
-
cache_dir: Annotated[
64
-
Optional[str], Option(help="Cache directory for datasets and models.", rich_help_panel=HELP_PANEL_NAME_1)
65
-
] =None,
66
63
num_fewshot_seeds: Annotated[
67
64
int, Option(help="Number of seeds to use for few-shot evaluation.", rich_help_panel=HELP_PANEL_NAME_1)
68
65
] =1,
@@ -73,6 +70,13 @@ def accelerate( # noqa C901
73
70
output_dir: Annotated[
74
71
str, Option(help="Output directory for evaluation results.", rich_help_panel=HELP_PANEL_NAME_2)
75
72
] ="results",
73
+
results_path_template: Annotated[
74
+
str|None,
75
+
Option(
76
+
help="Template path for where to save the results, you have access to 3 variables, `output_dir`, `org` and `model`. for example a template can be `'{output_dir}/1234/{org}+{model}'`",
77
+
rich_help_panel=HELP_PANEL_NAME_2,
78
+
),
79
+
] =None,
76
80
push_to_hub: Annotated[
77
81
bool, Option(help="Push results to the huggingface hub.", rich_help_panel=HELP_PANEL_NAME_2)
Copy file name to clipboardExpand all lines: src/lighteval/main_custom.py
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -70,6 +70,13 @@ def custom(
70
70
output_dir: Annotated[
71
71
str, Option(help="Output directory for evaluation results.", rich_help_panel=HELP_PANNEL_NAME_2)
72
72
] ="results",
73
+
results_path_template: Annotated[
74
+
str|None,
75
+
Option(
76
+
help="Template path for where to save the results, you have access to 3 variables, `output_dir`, `org` and `model`. for example a template can be `'{output_dir}/1234/{org}+{model}'`",
77
+
rich_help_panel=HELP_PANNEL_NAME_2,
78
+
),
79
+
] =None,
73
80
push_to_hub: Annotated[
74
81
bool, Option(help="Push results to the huggingface hub.", rich_help_panel=HELP_PANNEL_NAME_2)
Copy file name to clipboardExpand all lines: src/lighteval/main_endpoint.py
+32Lines changed: 32 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -72,6 +72,13 @@ def inference_endpoint(
72
72
output_dir: Annotated[
73
73
str, Option(help="Output directory for evaluation results.", rich_help_panel=HELP_PANEL_NAME_2)
74
74
] ="results",
75
+
results_path_template: Annotated[
76
+
str|None,
77
+
Option(
78
+
help="Template path for where to save the results, you have access to 3 variables, `output_dir`, `org` and `model`. for example a template can be `'{output_dir}/1234/{org}+{model}'`",
79
+
rich_help_panel=HELP_PANEL_NAME_2,
80
+
),
81
+
] =None,
75
82
push_to_hub: Annotated[
76
83
bool, Option(help="Push results to the huggingface hub.", rich_help_panel=HELP_PANEL_NAME_2)
77
84
] =False,
@@ -111,6 +118,7 @@ def inference_endpoint(
111
118
112
119
evaluation_tracker=EvaluationTracker(
113
120
output_dir=output_dir,
121
+
results_path_template=results_path_template,
114
122
save_details=save_details,
115
123
push_to_hub=push_to_hub,
116
124
push_to_tensorboard=push_to_tensorboard,
@@ -185,6 +193,13 @@ def tgi(
185
193
output_dir: Annotated[
186
194
str, Option(help="Output directory for evaluation results.", rich_help_panel=HELP_PANEL_NAME_2)
187
195
] ="results",
196
+
results_path_template: Annotated[
197
+
str|None,
198
+
Option(
199
+
help="Template path for where to save the results, you have access to 3 variables, `output_dir`, `org` and `model`. for example a template can be `'{output_dir}/1234/{org}+{model}'`",
200
+
rich_help_panel=HELP_PANEL_NAME_2,
201
+
),
202
+
] =None,
188
203
push_to_hub: Annotated[
189
204
bool, Option(help="Push results to the huggingface hub.", rich_help_panel=HELP_PANEL_NAME_2)
190
205
] =False,
@@ -227,6 +242,7 @@ def tgi(
227
242
228
243
evaluation_tracker=EvaluationTracker(
229
244
output_dir=output_dir,
245
+
results_path_template=results_path_template,
230
246
save_details=save_details,
231
247
push_to_hub=push_to_hub,
232
248
push_to_tensorboard=push_to_tensorboard,
@@ -302,6 +318,13 @@ def litellm(
302
318
output_dir: Annotated[
303
319
str, Option(help="Output directory for evaluation results.", rich_help_panel=HELP_PANEL_NAME_2)
304
320
] ="results",
321
+
results_path_template: Annotated[
322
+
str|None,
323
+
Option(
324
+
help="Template path for where to save the results, you have access to 3 variables, `output_dir`, `org` and `model`. for example a template can be `'{output_dir}/1234/{org}+{model}'`",
325
+
rich_help_panel=HELP_PANEL_NAME_2,
326
+
),
327
+
] =None,
305
328
push_to_hub: Annotated[
306
329
bool, Option(help="Push results to the huggingface hub.", rich_help_panel=HELP_PANEL_NAME_2)
307
330
] =False,
@@ -344,6 +367,7 @@ def litellm(
344
367
345
368
evaluation_tracker=EvaluationTracker(
346
369
output_dir=output_dir,
370
+
results_path_template=results_path_template,
347
371
save_details=save_details,
348
372
push_to_hub=push_to_hub,
349
373
push_to_tensorboard=push_to_tensorboard,
@@ -420,6 +444,13 @@ def inference_providers(
420
444
output_dir: Annotated[
421
445
str, Option(help="Output directory for evaluation results.", rich_help_panel=HELP_PANEL_NAME_2)
422
446
] ="results",
447
+
results_path_template: Annotated[
448
+
str|None,
449
+
Option(
450
+
help="Template path for where to save the results, you have access to 3 variables, `output_dir`, `org` and `model`. for example a template can be `'{output_dir}/1234/{org}+{model}'`",
451
+
rich_help_panel=HELP_PANEL_NAME_2,
452
+
),
453
+
] =None,
423
454
push_to_hub: Annotated[
424
455
bool, Option(help="Push results to the huggingface hub.", rich_help_panel=HELP_PANEL_NAME_2)
Copy file name to clipboardExpand all lines: src/lighteval/main_sglang.py
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,13 @@ def sglang(
63
63
output_dir: Annotated[
64
64
str, Option(help="Output directory for evaluation results.", rich_help_panel=HELP_PANEL_NAME_2)
65
65
] ="results",
66
+
results_path_template: Annotated[
67
+
str|None,
68
+
Option(
69
+
help="Template path for where to save the results, you have access to 3 variables, `output_dir`, `org` and `model`. for example a template can be `'{output_dir}/1234/{org}+{model}'`",
70
+
rich_help_panel=HELP_PANEL_NAME_2,
71
+
),
72
+
] =None,
66
73
push_to_hub: Annotated[
67
74
bool, Option(help="Push results to the huggingface hub.", rich_help_panel=HELP_PANEL_NAME_2)
Copy file name to clipboardExpand all lines: src/lighteval/main_vllm.py
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,13 @@ def vllm(
66
66
output_dir: Annotated[
67
67
str, Option(help="Output directory for evaluation results.", rich_help_panel=HELP_PANEL_NAME_2)
68
68
] ="results",
69
+
results_path_template: Annotated[
70
+
str|None,
71
+
Option(
72
+
help="Template path for where to save the results, you have access to 3 variables, `output_dir`, `org` and `model`. for example a template can be `'{output_dir}/1234/{org}+{model}'`",
73
+
rich_help_panel=HELP_PANEL_NAME_2,
74
+
),
75
+
] =None,
69
76
push_to_hub: Annotated[
70
77
bool, Option(help="Push results to the huggingface hub.", rich_help_panel=HELP_PANEL_NAME_2)
0 commit comments