eval-framework 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. eval_framework/__init__.py +7 -0
  2. eval_framework/base_config.py +36 -0
  3. eval_framework/context/__init__.py +0 -0
  4. eval_framework/context/determined.py +170 -0
  5. eval_framework/context/eval.py +114 -0
  6. eval_framework/context/local.py +52 -0
  7. eval_framework/evaluation_generator.py +231 -0
  8. eval_framework/exceptions.py +2 -0
  9. eval_framework/external/ifeval_impl/README.md +5 -0
  10. eval_framework/external/ifeval_impl/instructions.py +1523 -0
  11. eval_framework/external/ifeval_impl/instructions_registry.py +161 -0
  12. eval_framework/external/ifeval_impl/instructions_util.py +1689 -0
  13. eval_framework/external/ifeval_impl/utils.py +135 -0
  14. eval_framework/llm/__init__.py +0 -0
  15. eval_framework/llm/aleph_alpha.py +323 -0
  16. eval_framework/llm/base.py +58 -0
  17. eval_framework/llm/huggingface.py +332 -0
  18. eval_framework/llm/mistral.py +73 -0
  19. eval_framework/llm/models.py +16 -0
  20. eval_framework/llm/openai.py +205 -0
  21. eval_framework/llm/vllm.py +438 -0
  22. eval_framework/logger.py +3 -0
  23. eval_framework/main.py +187 -0
  24. eval_framework/metrics/__init__.py +0 -0
  25. eval_framework/metrics/base.py +40 -0
  26. eval_framework/metrics/completion/__init__.py +1 -0
  27. eval_framework/metrics/completion/accuracy_completion.py +16 -0
  28. eval_framework/metrics/completion/bleu.py +76 -0
  29. eval_framework/metrics/completion/chrf.py +62 -0
  30. eval_framework/metrics/completion/code_assertion.py +44 -0
  31. eval_framework/metrics/completion/code_execution_pass_at_one.py +126 -0
  32. eval_framework/metrics/completion/comet.py +56 -0
  33. eval_framework/metrics/completion/concordance_index.py +38 -0
  34. eval_framework/metrics/completion/csv_format.py +102 -0
  35. eval_framework/metrics/completion/cwe_accuracy.py +49 -0
  36. eval_framework/metrics/completion/exponential_similarity.py +65 -0
  37. eval_framework/metrics/completion/f1.py +42 -0
  38. eval_framework/metrics/completion/format_checker.py +56 -0
  39. eval_framework/metrics/completion/grid_difference.py +77 -0
  40. eval_framework/metrics/completion/ifeval.py +73 -0
  41. eval_framework/metrics/completion/json_format.py +171 -0
  42. eval_framework/metrics/completion/language_checker.py +74 -0
  43. eval_framework/metrics/completion/length_control.py +83 -0
  44. eval_framework/metrics/completion/math_reasoning_completion.py +303 -0
  45. eval_framework/metrics/completion/niah_accuracy.py +163 -0
  46. eval_framework/metrics/completion/placeholder_checker.py +27 -0
  47. eval_framework/metrics/completion/repetition.py +88 -0
  48. eval_framework/metrics/completion/rouge_1.py +35 -0
  49. eval_framework/metrics/completion/rouge_2.py +45 -0
  50. eval_framework/metrics/completion/rouge_geometric_mean.py +36 -0
  51. eval_framework/metrics/completion/rouge_l.py +52 -0
  52. eval_framework/metrics/completion/struct_eval_metrics.py +248 -0
  53. eval_framework/metrics/completion/ter.py +67 -0
  54. eval_framework/metrics/completion/text_counter.py +182 -0
  55. eval_framework/metrics/efficiency/__init__.py +0 -0
  56. eval_framework/metrics/efficiency/bytes_per_sequence_position.py +48 -0
  57. eval_framework/metrics/llm/__init__.py +0 -0
  58. eval_framework/metrics/llm/base.py +8 -0
  59. eval_framework/metrics/llm/graders/chatbot_style_grader.py +92 -0
  60. eval_framework/metrics/llm/graders/comparison_grader.py +146 -0
  61. eval_framework/metrics/llm/graders/conciseness_grader.py +93 -0
  62. eval_framework/metrics/llm/graders/contains_names_grader.py +71 -0
  63. eval_framework/metrics/llm/graders/format_correctness_grader.py +109 -0
  64. eval_framework/metrics/llm/graders/instruction_grader.py +177 -0
  65. eval_framework/metrics/llm/graders/language.py +56 -0
  66. eval_framework/metrics/llm/graders/long_context_grader.py +72 -0
  67. eval_framework/metrics/llm/graders/models.py +74 -0
  68. eval_framework/metrics/llm/graders/refusal_grader.py +57 -0
  69. eval_framework/metrics/llm/graders/sql_quality_grader.py +145 -0
  70. eval_framework/metrics/llm/graders/summary_world_knowledge_grader.py +103 -0
  71. eval_framework/metrics/llm/llm_judge_chatbot_style.py +36 -0
  72. eval_framework/metrics/llm/llm_judge_completion_accuracy.py +39 -0
  73. eval_framework/metrics/llm/llm_judge_conciseness.py +37 -0
  74. eval_framework/metrics/llm/llm_judge_contains_names.py +36 -0
  75. eval_framework/metrics/llm/llm_judge_format_correctness.py +43 -0
  76. eval_framework/metrics/llm/llm_judge_instruction.py +58 -0
  77. eval_framework/metrics/llm/llm_judge_mtbench_pair.py +205 -0
  78. eval_framework/metrics/llm/llm_judge_mtbench_single.py +188 -0
  79. eval_framework/metrics/llm/llm_judge_refusal.py +35 -0
  80. eval_framework/metrics/llm/llm_judge_sql.py +394 -0
  81. eval_framework/metrics/llm/llm_judge_world_knowledge.py +37 -0
  82. eval_framework/metrics/loglikelihood/__init__.py +0 -0
  83. eval_framework/metrics/loglikelihood/accuracy_loglikelihood.py +51 -0
  84. eval_framework/metrics/loglikelihood/probability_mass.py +56 -0
  85. eval_framework/py.typed +0 -0
  86. eval_framework/response_generator.py +416 -0
  87. eval_framework/result_processors/__init__.py +0 -0
  88. eval_framework/result_processors/base.py +74 -0
  89. eval_framework/result_processors/hf_processor.py +87 -0
  90. eval_framework/result_processors/result_processor.py +129 -0
  91. eval_framework/run.py +314 -0
  92. eval_framework/run_direct.py +42 -0
  93. eval_framework/shared/types.py +227 -0
  94. eval_framework/tasks/__init__.py +6 -0
  95. eval_framework/tasks/base.py +314 -0
  96. eval_framework/tasks/benchmarks/__init__.py +0 -0
  97. eval_framework/tasks/benchmarks/arc.py +46 -0
  98. eval_framework/tasks/benchmarks/arc_de.py +46 -0
  99. eval_framework/tasks/benchmarks/arc_fi.py +46 -0
  100. eval_framework/tasks/benchmarks/belebele.py +60 -0
  101. eval_framework/tasks/benchmarks/bigcodebench.py +155 -0
  102. eval_framework/tasks/benchmarks/casehold.py +47 -0
  103. eval_framework/tasks/benchmarks/chembench.py +85 -0
  104. eval_framework/tasks/benchmarks/copa.py +39 -0
  105. eval_framework/tasks/benchmarks/duc.py +91 -0
  106. eval_framework/tasks/benchmarks/flores200.py +62 -0
  107. eval_framework/tasks/benchmarks/flores_plus.py +84 -0
  108. eval_framework/tasks/benchmarks/gpqa.py +177 -0
  109. eval_framework/tasks/benchmarks/gsm8k.py +148 -0
  110. eval_framework/tasks/benchmarks/hellaswag.py +44 -0
  111. eval_framework/tasks/benchmarks/hellaswag_de.py +52 -0
  112. eval_framework/tasks/benchmarks/humaneval.py +97 -0
  113. eval_framework/tasks/benchmarks/ifeval.py +78 -0
  114. eval_framework/tasks/benchmarks/include.py +119 -0
  115. eval_framework/tasks/benchmarks/infinitebench.py +302 -0
  116. eval_framework/tasks/benchmarks/math_reasoning.py +569 -0
  117. eval_framework/tasks/benchmarks/mbpp.py +192 -0
  118. eval_framework/tasks/benchmarks/mmlu.py +190 -0
  119. eval_framework/tasks/benchmarks/mmlu_de.py +109 -0
  120. eval_framework/tasks/benchmarks/mmlu_pro.py +139 -0
  121. eval_framework/tasks/benchmarks/mmmlu.py +529 -0
  122. eval_framework/tasks/benchmarks/openbookqa.py +37 -0
  123. eval_framework/tasks/benchmarks/opengptx_eu20.py +363 -0
  124. eval_framework/tasks/benchmarks/pawsx.py +65 -0
  125. eval_framework/tasks/benchmarks/piqa.py +39 -0
  126. eval_framework/tasks/benchmarks/quality.py +56 -0
  127. eval_framework/tasks/benchmarks/sciq.py +44 -0
  128. eval_framework/tasks/benchmarks/sphyr.py +75 -0
  129. eval_framework/tasks/benchmarks/squad.py +89 -0
  130. eval_framework/tasks/benchmarks/struct_eval.py +110 -0
  131. eval_framework/tasks/benchmarks/tablebench.py +117 -0
  132. eval_framework/tasks/benchmarks/triviaqa.py +42 -0
  133. eval_framework/tasks/benchmarks/truthfulqa.py +95 -0
  134. eval_framework/tasks/benchmarks/winogender.py +39 -0
  135. eval_framework/tasks/benchmarks/winogrande.py +44 -0
  136. eval_framework/tasks/benchmarks/winox.py +57 -0
  137. eval_framework/tasks/benchmarks/wmt.py +160 -0
  138. eval_framework/tasks/benchmarks/zero_scrolls.py +197 -0
  139. eval_framework/tasks/eval_config.py +112 -0
  140. eval_framework/tasks/perturbation.py +83 -0
  141. eval_framework/tasks/registry.py +186 -0
  142. eval_framework/tasks/task_loader.py +80 -0
  143. eval_framework/tasks/task_names.py +138 -0
  144. eval_framework/tasks/utils.py +578 -0
  145. eval_framework/utils/constants.py +9 -0
  146. eval_framework/utils/generate_task_docs.py +229 -0
  147. eval_framework/utils/helpers.py +3 -0
  148. eval_framework/utils/logging.py +50 -0
  149. eval_framework/utils/packaging.py +52 -0
  150. eval_framework-0.2.0.dist-info/METADATA +514 -0
  151. eval_framework-0.2.0.dist-info/RECORD +161 -0
  152. eval_framework-0.2.0.dist-info/WHEEL +4 -0
  153. eval_framework-0.2.0.dist-info/entry_points.txt +3 -0
  154. template_formatting/README.md +83 -0
  155. template_formatting/__init__.py +0 -0
  156. template_formatting/formatter.py +536 -0
  157. template_formatting/mistral_formatter.py +159 -0
  158. template_formatting/py.typed +0 -0
  159. template_formatting/tests/test_formatter_eval.py +408 -0
  160. template_formatting/tests/test_formatter_scaling.py +253 -0
  161. template_formatting/tests/test_mistral_formatter.py +136 -0
@@ -0,0 +1,514 @@
1
+ Metadata-Version: 2.3
2
+ Name: eval-framework
3
+ Version: 0.2.0
4
+ Summary: Evalulation Framework
5
+ Author: Aleph Alpha Research
6
+ License: Apache License
7
+ Version 2.0, January 2004
8
+ http://www.apache.org/licenses/
9
+
10
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
11
+
12
+ 1. Definitions.
13
+
14
+ "License" shall mean the terms and conditions for use, reproduction,
15
+ and distribution as defined by Sections 1 through 9 of this document.
16
+
17
+ "Licensor" shall mean the copyright owner or entity authorized by
18
+ the copyright owner that is granting the License.
19
+
20
+ "Legal Entity" shall mean the union of the acting entity and all
21
+ other entities that control, are controlled by, or are under common
22
+ control with that entity. For the purposes of this definition,
23
+ "control" means (i) the power, direct or indirect, to cause the
24
+ direction or management of such entity, whether by contract or
25
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
26
+ outstanding shares, or (iii) beneficial ownership of such entity.
27
+
28
+ "You" (or "Your") shall mean an individual or Legal Entity
29
+ exercising permissions granted by this License.
30
+
31
+ "Source" form shall mean the preferred form for making modifications,
32
+ including but not limited to software source code, documentation
33
+ source, and configuration files.
34
+
35
+ "Object" form shall mean any form resulting from mechanical
36
+ transformation or translation of a Source form, including but
37
+ not limited to compiled object code, generated documentation,
38
+ and conversions to other media types.
39
+
40
+ "Work" shall mean the work of authorship, whether in Source or
41
+ Object form, made available under the License, as indicated by a
42
+ copyright notice that is included in or attached to the work
43
+ (an example is provided in the Appendix below).
44
+
45
+ "Derivative Works" shall mean any work, whether in Source or Object
46
+ form, that is based on (or derived from) the Work and for which the
47
+ editorial revisions, annotations, elaborations, or other modifications
48
+ represent, as a whole, an original work of authorship. For the purposes
49
+ of this License, Derivative Works shall not include works that remain
50
+ separable from, or merely link (or bind by name) to the interfaces of,
51
+ the Work and Derivative Works thereof.
52
+
53
+ "Contribution" shall mean any work of authorship, including
54
+ the original version of the Work and any modifications or additions
55
+ to that Work or Derivative Works thereof, that is intentionally
56
+ submitted to Licensor for inclusion in the Work by the copyright owner
57
+ or by an individual or Legal Entity authorized to submit on behalf of
58
+ the copyright owner. For the purposes of this definition, "submitted"
59
+ means any form of electronic, verbal, or written communication sent
60
+ to the Licensor or its representatives, including but not limited to
61
+ communication on electronic mailing lists, source code control systems,
62
+ and issue tracking systems that are managed by, or on behalf of, the
63
+ Licensor for the purpose of discussing and improving the Work, but
64
+ excluding communication that is conspicuously marked or otherwise
65
+ designated in writing by the copyright owner as "Not a Contribution."
66
+
67
+ "Contributor" shall mean Licensor and any individual or Legal Entity
68
+ on behalf of whom a Contribution has been received by Licensor and
69
+ subsequently incorporated within the Work.
70
+
71
+ 2. Grant of Copyright License. Subject to the terms and conditions of
72
+ this License, each Contributor hereby grants to You a perpetual,
73
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
74
+ copyright license to reproduce, prepare Derivative Works of,
75
+ publicly display, publicly perform, sublicense, and distribute the
76
+ Work and such Derivative Works in Source or Object form.
77
+
78
+ 3. Grant of Patent License. Subject to the terms and conditions of
79
+ this License, each Contributor hereby grants to You a perpetual,
80
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
81
+ (except as stated in this section) patent license to make, have made,
82
+ use, offer to sell, sell, import, and otherwise transfer the Work,
83
+ where such license applies only to those patent claims licensable
84
+ by such Contributor that are necessarily infringed by their
85
+ Contribution(s) alone or by combination of their Contribution(s)
86
+ with the Work to which such Contribution(s) was submitted. If You
87
+ institute patent litigation against any entity (including a
88
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
89
+ or a Contribution incorporated within the Work constitutes direct
90
+ or contributory patent infringement, then any patent licenses
91
+ granted to You under this License for that Work shall terminate
92
+ as of the date such litigation is filed.
93
+
94
+ 4. Redistribution. You may reproduce and distribute copies of the
95
+ Work or Derivative Works thereof in any medium, with or without
96
+ modifications, and in Source or Object form, provided that You
97
+ meet the following conditions:
98
+
99
+ (a) You must give any other recipients of the Work or
100
+ Derivative Works a copy of this License; and
101
+
102
+ (b) You must cause any modified files to carry prominent notices
103
+ stating that You changed the files; and
104
+
105
+ (c) You must retain, in the Source form of any Derivative Works
106
+ that You distribute, all copyright, patent, trademark, and
107
+ attribution notices from the Source form of the Work,
108
+ excluding those notices that do not pertain to any part of
109
+ the Derivative Works; and
110
+
111
+ (d) If the Work includes a "NOTICE" text file as part of its
112
+ distribution, then any Derivative Works that You distribute must
113
+ include a readable copy of the attribution notices contained
114
+ within such NOTICE file, excluding those notices that do not
115
+ pertain to any part of the Derivative Works, in at least one
116
+ of the following places: within a NOTICE text file distributed
117
+ as part of the Derivative Works; within the Source form or
118
+ documentation, if provided along with the Derivative Works; or,
119
+ within a display generated by the Derivative Works, if and
120
+ wherever such third-party notices normally appear. The contents
121
+ of the NOTICE file are for informational purposes only and
122
+ do not modify the License. You may add Your own attribution
123
+ notices within Derivative Works that You distribute, alongside
124
+ or as an addendum to the NOTICE text from the Work, provided
125
+ that such additional attribution notices cannot be construed
126
+ as modifying the License.
127
+
128
+ You may add Your own copyright statement to Your modifications and
129
+ may provide additional or different license terms and conditions
130
+ for use, reproduction, or distribution of Your modifications, or
131
+ for any such Derivative Works as a whole, provided Your use,
132
+ reproduction, and distribution of the Work otherwise complies with
133
+ the conditions stated in this License.
134
+
135
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
136
+ any Contribution intentionally submitted for inclusion in the Work
137
+ by You to the Licensor shall be under the terms and conditions of
138
+ this License, without any additional terms or conditions.
139
+ Notwithstanding the above, nothing herein shall supersede or modify
140
+ the terms of any separate license agreement you may have executed
141
+ with Licensor regarding such Contributions.
142
+
143
+ 6. Trademarks. This License does not grant permission to use the trade
144
+ names, trademarks, service marks, or product names of the Licensor,
145
+ except as required for reasonable and customary use in describing the
146
+ origin of the Work and reproducing the content of the NOTICE file.
147
+
148
+ 7. Disclaimer of Warranty. Unless required by applicable law or
149
+ agreed to in writing, Licensor provides the Work (and each
150
+ Contributor provides its Contributions) on an "AS IS" BASIS,
151
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
152
+ implied, including, without limitation, any warranties or conditions
153
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
154
+ PARTICULAR PURPOSE. You are solely responsible for determining the
155
+ appropriateness of using or redistributing the Work and assume any
156
+ risks associated with Your exercise of permissions under this License.
157
+
158
+ 8. Limitation of Liability. In no event and under no legal theory,
159
+ whether in tort (including negligence), contract, or otherwise,
160
+ unless required by applicable law (such as deliberate and grossly
161
+ negligent acts) or agreed to in writing, shall any Contributor be
162
+ liable to You for damages, including any direct, indirect, special,
163
+ incidental, or consequential damages of any character arising as a
164
+ result of this License or out of the use or inability to use the
165
+ Work (including but not limited to damages for loss of goodwill,
166
+ work stoppage, computer failure or malfunction, or any and all
167
+ other commercial damages or losses), even if such Contributor
168
+ has been advised of the possibility of such damages.
169
+
170
+ 9. Accepting Warranty or Additional Liability. While redistributing
171
+ the Work or Derivative Works thereof, You may choose to offer,
172
+ and charge a fee for, acceptance of support, warranty, indemnity,
173
+ or other liability obligations and/or rights consistent with this
174
+ License. However, in accepting such obligations, You may act only
175
+ on Your own behalf and on Your sole responsibility, not on behalf
176
+ of any other Contributor, and only if You agree to indemnify,
177
+ defend, and hold each Contributor harmless for any liability
178
+ incurred by, or claims asserted against, such Contributor by reason
179
+ of your accepting any such warranty or additional liability.
180
+
181
+ END OF TERMS AND CONDITIONS
182
+
183
+ APPENDIX: How to apply the Apache License to your work.
184
+
185
+ To apply the Apache License to your work, attach the following
186
+ boilerplate notice, with the fields enclosed by brackets "[]"
187
+ replaced with your own identifying information. (Don't include
188
+ the brackets!) The text should be enclosed in the appropriate
189
+ comment syntax for the file format. We also recommend that a
190
+ file or class name and description of purpose be included on the
191
+ same "printed page" as the copyright notice for easier
192
+ identification within third-party archives.
193
+
194
+ Copyright [yyyy] [name of copyright owner]
195
+
196
+ Licensed under the Apache License, Version 2.0 (the "License");
197
+ you may not use this file except in compliance with the License.
198
+ You may obtain a copy of the License at
199
+
200
+ http://www.apache.org/licenses/LICENSE-2.0
201
+
202
+ Unless required by applicable law or agreed to in writing, software
203
+ distributed under the License is distributed on an "AS IS" BASIS,
204
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
205
+ See the License for the specific language governing permissions and
206
+ limitations under the License.
207
+ Classifier: Operating System :: OS Independent
208
+ Classifier: License :: OSI Approved :: Apache Software License
209
+ Classifier: Programming Language :: Python
210
+ Classifier: Programming Language :: Python :: 3.12
211
+ Classifier: Programming Language :: Python :: 3 :: Only
212
+ Classifier: Topic :: Software Development :: Libraries
213
+ Classifier: Typing :: Typed
214
+ Requires-Dist: pyyaml>=6.0.1,<7
215
+ Requires-Dist: xmltodict>=0.13.0,<0.16
216
+ Requires-Dist: pydantic>=2.7,<3
217
+ Requires-Dist: datasets>=2.19.1,<4
218
+ Requires-Dist: sacrebleu>=2.4.3,<3
219
+ Requires-Dist: pycountry>=24.6.1,<25
220
+ Requires-Dist: nltk>=3.9.1,<4
221
+ Requires-Dist: types-pyyaml>=6.0.12.20240917,<7
222
+ Requires-Dist: psutil>=6.1,<7
223
+ Requires-Dist: python-dotenv>=1.0.1,<2
224
+ Requires-Dist: lingua-language-detector>=2.0.2,<3
225
+ Requires-Dist: google-crc32c>=1.5.0,<2
226
+ Requires-Dist: kubernetes>=31.0.0,<32
227
+ Requires-Dist: langdetect>=1.0.9,<2
228
+ Requires-Dist: spacy>=3.8.3,<4
229
+ Requires-Dist: jsonschema>=4.23.0,<5
230
+ Requires-Dist: mysql-connector-python>=9.0.0,<10
231
+ Requires-Dist: psycopg2-binary>=2.9.9,<3
232
+ Requires-Dist: sympy>=1.13.1,<2
233
+ Requires-Dist: llm-sandbox[docker]>=0.1.8,<0.2
234
+ Requires-Dist: jsonlines>=4,<5
235
+ Requires-Dist: lxml>=6,<7
236
+ Requires-Dist: python-iso639>=2025.2.18
237
+ Requires-Dist: wandb>=0.21.1,<1
238
+ Requires-Dist: torch
239
+ Requires-Dist: accelerate ; extra == 'accelerate'
240
+ Requires-Dist: eval-framework[determined,api,openai,transformers,accelerate,vllm,comet,optional,mistral] ; extra == 'all'
241
+ Requires-Dist: aleph-alpha-client>=10,<11 ; extra == 'api'
242
+ Requires-Dist: unbabel-comet>=2.2.6,<3 ; extra == 'comet'
243
+ Requires-Dist: determined>=0.38,<0.39 ; extra == 'determined'
244
+ Requires-Dist: tensorboard==2.19.0 ; extra == 'determined'
245
+ Requires-Dist: mistral-common>=1.7,<2 ; extra == 'mistral'
246
+ Requires-Dist: huggingface-hub>=0.33.2,<0.34 ; extra == 'mistral'
247
+ Requires-Dist: eval-framework[vllm] ; extra == 'mistral'
248
+ Requires-Dist: openai>=1.62,<2 ; extra == 'openai'
249
+ Requires-Dist: tiktoken>=0.9,<0.10 ; extra == 'openai'
250
+ Requires-Dist: transformers>=4.45.2,<5 ; extra == 'optional'
251
+ Requires-Dist: jinja2>=3.1.6,<4 ; extra == 'optional'
252
+ Requires-Dist: transformers>=4.45.2,<5 ; extra == 'transformers'
253
+ Requires-Dist: torch>=2.5,<3 ; extra == 'transformers'
254
+ Requires-Dist: vllm>=0.8.5,<0.9 ; extra == 'vllm'
255
+ Requires-Dist: torch>=2.5,<3 ; extra == 'vllm'
256
+ Requires-Python: >=3.12, <3.13
257
+ Project-URL: repository, https://github.com/Aleph-Alpha-Research/eval-framework
258
+ Provides-Extra: accelerate
259
+ Provides-Extra: all
260
+ Provides-Extra: api
261
+ Provides-Extra: comet
262
+ Provides-Extra: determined
263
+ Provides-Extra: mistral
264
+ Provides-Extra: openai
265
+ Provides-Extra: optional
266
+ Provides-Extra: transformers
267
+ Provides-Extra: vllm
268
+ Description-Content-Type: text/markdown
269
+
270
+ # Aleph Alpha Eval-Framework
271
+
272
+ > **Comprehensive LLM evaluation at scale** - A production-ready framework for evaluating large language models across 90+ benchmarks.
273
+
274
+ ## Features
275
+
276
+ - 90+ Benchmarks: Covers reasoning, knowledge, coding, long-context, and safety tasks.
277
+ - Custom Benchmarks: Easily add new benchmarks with minimal code using the BaseTask class.
278
+ - Distributed Evaluation: Integration with Determined AI for scalable distributed evaluation.
279
+ - Docker Support: Pre-configured Dockerfiles for local and distributed setups.
280
+ - Flexible Model Integration: Supports models loaded via HuggingFace Transformers or custom implementations using the BaseLLM class.
281
+ - Custom Metrics: Easily define new metrics using the BaseMetric class.
282
+ - Rich Outputs: Generates JSON results, plots, and detailed analysis reports.
283
+ - Perturbation Testing: Robustness analysis with configurable perturbation types and probabilities.
284
+ - Statistical Analysis: Includes confidence intervals and significance testing for reliable comparisons.
285
+ - LLM-as-a-Judge: Evaluation using LLM judges.
286
+
287
+ ![eval-framework](docs/eval-framework.png "eval-framework")
288
+
289
+ ## Benchmark Coverage & Task Categories
290
+
291
+ ### Core Capabilities
292
+
293
+ | **Reasoning** | **Knowledge** | **Coding** | **Long Context** |
294
+ |---------------|---------------|------------|------------------|
295
+ | MMLU (57 subjects) | TriviaQA | HumanEval | InfiniteBench |
296
+ | SQuAD v1/v2 | MBPP |
297
+ | ARC | Natural Questions | CodeT5 | ZeroSCROLLS |
298
+ | HellaSwag | QuAC | Programming | QuALITY |
299
+ | Winogrande | COPA | Debugging |
300
+
301
+ ### Languages & Domains
302
+
303
+ | **Multilingual** | **Specialized** | **Safety & Bias** | **Efficiency** |
304
+ |------------------|-----------------|-------------------|----------------|
305
+ | WMT Translation | Legal (CaseHold) | TruthfulQA | Token counting |
306
+ | FLORES-200 | Winogender | Latency metrics |
307
+ | Multilingual MMLU | Medical (MedQA) | Stereotype detection | Memory usage |
308
+ | German/Finnish tasks | Scientific (SciQ) | Harmful content | Cost analysis |
309
+
310
+ ### Completion
311
+
312
+ Tasks focused on logical reasoning, text distillation, instruction following, and output control. Examples include:
313
+ - **AIME 2024:** Logical Reasoning (Math)
314
+ - **DUC Abstractive:** Text Distillation (Extraction)
315
+ - **Custom Data: Complaint Summarization:** Text Distillation (Summarization)
316
+
317
+ ### Loglikelihoods
318
+
319
+ Tasks emphasizing classification, reasoning, and open QA. Examples include:
320
+ - **Abstract Reasoning Challenge (ARC):** Classification
321
+ - **Casehold:** Open QA
322
+
323
+ ### Long-Context
324
+
325
+ Tasks designed for long-context scenarios, including QA, summarization, and aggregation. Examples include:
326
+ - **InfiniteBench_CodeDebug:** Programming
327
+ - **ZeroSCROLLS GovReport:** QA (Government)
328
+
329
+ ### Metrics
330
+
331
+ Evaluation metrics include:
332
+ - **Completion Metrics:** Accuracy, Bleu, F1, Rouge
333
+ - **Loglikelihood Metrics:** Accuracy Loglikelihood, Probability Mass
334
+ - **LLM Metrics:** Chatbot Style Judge, Instruction Judge
335
+ - **Efficiency Metrics:** Bytes per Sequence Position
336
+
337
+ For the full list of tasks and metrics, see [Detailed Task Table](docs/benchmarks_and_metrics.md).
338
+
339
+ ## Quick Start
340
+
341
+ The codebase is tested and compatible with Python 3.12 and PyTorch 2.5.
342
+ You will also need the appropriate CUDA dependencies and version installed on your system for GPU support.
343
+
344
+ The easiest way to get started is by installing the library via `pip` and use it as an external dependency.
345
+ ```
346
+ pip install eval_framework
347
+ ```
348
+
349
+ There are optional extras available to unlock specific features of the library:
350
+ - `mistral` for inference on Mistral models
351
+ - `transformers` for inference using the transformers library
352
+ - `api` for inference using the aleph-alpha client.
353
+ - `vllm` for inference via VLLM
354
+ - `determined` for running jobs via determined
355
+ - `comet` for the COMET metric
356
+
357
+ As a short hand, the `all` extra installs all of the above.
358
+
359
+ For development, you can instead install it directly from the repository instead, please first install
360
+ [uv](https://docs.astral.sh/uv/getting-started/installation/)
361
+
362
+ To install the project with all optional extras use
363
+ ```bash
364
+ uv sync --all-extras
365
+ ```
366
+
367
+ We provide custom groups to control optional extras.
368
+ - `cpu`: Use the CPU backend for torch
369
+ - `cu124`: Use the CUDA 12.4 backend
370
+ - `flash_attn`: Install `flash_attn` with correct handling of build isolation
371
+
372
+ Thus, the following will setup the project with `flash_attn` and CUDA 12.4
373
+ ```bash
374
+ uv sync --all-extras --group flash_attn --group cu124
375
+ ```
376
+
377
+ There is also a pre-commit hook to help with development:
378
+ ```
379
+ uv run pre-commit install
380
+ ```
381
+
382
+ After installation, task documentation can be generated with `uv run python src/eval_framework/utils/generate_task_docs.py` (see [docs/installation.md(docs/installation.md)) for more details.
383
+
384
+ ## Getting Started
385
+
386
+ ### Understanding the Evaluation Framework
387
+
388
+ Eval-Framework provides a unified interface for evaluating language models across diverse benchmarks. The framework follows this interaction model:
389
+
390
+ 1. **Define Your Model** - Specify which model to evaluate (HuggingFace, API, or custom)
391
+ 2. **Choose Your Task** - Select from 150+ available benchmarks or create custom ones
392
+ 3. **Configure Evaluation** - Set parameters like few-shot examples, sample count, and output format
393
+ 4. **Run Evaluation** - Execute locally via CLI/script or distribute via Determined AI
394
+ 5. **Analyze Results** - Review detailed JSON outputs, metrics, and generated reports
395
+
396
+ ### Core Components
397
+
398
+ - **Models**: Defined via [`BaseLLM`](docs/evaluate_huggingface_model.md) interface (HuggingFace, OpenAI, custom APIs)
399
+ - **Tasks**: Inherit from [`BaseTask`](docs/add_new_benchmark_guide.md) (completion, loglikelihood, or LLM-judge based)
400
+ - **Metrics**: Automatic scoring via [`BaseMetric`](docs/benchmarks_and_metrics.md) classes
401
+ - **Formatters**: Handle prompt construction and model-specific formatting
402
+ - **Results**: Structured outputs with sample-level details and aggregated statistics
403
+
404
+ ### Your First Evaluation
405
+
406
+ 1. **Install the framework** (see Quick Start above)
407
+ ```
408
+ pip install eval_framework[transformers]
409
+ ```
410
+
411
+ 2. **Create and run your first evaluation using HuggingFace model**:
412
+
413
+ ```python
414
+ from pathlib import Path
415
+
416
+ from eval_framework.llm.huggingface import HFLLM
417
+ from eval_framework.main import main
418
+ from eval_framework.tasks.eval_config import EvalConfig
419
+ from template_formatting.formatter import HFFormatter
420
+
421
+ # Define your model
422
+ class MyHuggingFaceModel(HFLLM):
423
+ LLM_NAME = "microsoft/DialoGPT-medium"
424
+ DEFAULT_FORMATTER = partial(HFFormatter, "microsoft/DialoGPT-medium")
425
+
426
+ if __name__ == "__main__":
427
+ # Initialize your model
428
+ llm = MyHuggingFaceModel()
429
+
430
+ # Running evaluation on GSM8K task using 5 few-shot examples and 10 samples
431
+ config = EvalConfig(
432
+ output_dir=Path("./eval_results"),
433
+ num_fewshot=5,
434
+ num_samples=10,
435
+ task_name="GSM8K",
436
+ llm_class=MyHuggingFaceModel,
437
+ )
438
+
439
+ # Run evaluation and get results
440
+ results = main(llm=llm, config=config)
441
+ ```
442
+
443
+ 3. **Review results** - Check `./eval_results/` for detailed outputs and use our [results guide](docs/understanding_results_guide.md) to interpret them
444
+
445
+ ### Next Steps
446
+
447
+ - **Use CLI interface**: See [CLI usage guide](docs/cli_usage.md) for command-line evaluation options
448
+ - **Evaluate HuggingFace models**: Follow our [HuggingFace evaluation guide](docs/evaluate_huggingface_model.md)
449
+ - **Create custom benchmarks**: Follow our [benchmark creation guide](docs/add_new_benchmark_guide.md)
450
+ - **Scale your evaluations**: Use [Determined AI integration](docs/using_determined.md) for distributed evaluation
451
+ - **Understand your results**: Read our [results interpretation guide](docs/understanding_results_guide.md)
452
+
453
+ ### Example CLI Usage
454
+
455
+ To evaluate a single benchmark locally, you can use the following command:
456
+
457
+ ```bash
458
+ eval_framework \
459
+ --models src/eval_framework/llm/models.py \
460
+ --llm-name Smollm135MInstruct \
461
+ --task-name "GSM8K" \
462
+ --output-dir ./eval \
463
+ --num-fewshot 5 \
464
+ --num-samples 10
465
+ ```
466
+
467
+ For more detailed CLI usage instructions, see the [CLI Usage Guide](docs/cli_usage.md).
468
+
469
+ ## Documentation
470
+
471
+ ### Getting Started
472
+
473
+ - **[CLI Usage Guide](docs/cli_usage.md)** - Detailed instructions for using the command-line interface
474
+ - **[Evaluating HuggingFace Models](docs/evaluate_huggingface_model.md)** - Complete guide for evaluating HuggingFace models
475
+ - **[Understanding Results](docs/understanding_results_guide.md)** - How to read and interpret evaluation results
476
+
477
+ ### Advanced Usage
478
+
479
+ - **[Adding New Benchmarks](docs/add_new_benchmark_guide.md)** - Complete guide with practical examples for adding new benchmarks
480
+ - **[Benchmarks and Metrics](docs/benchmarks_and_metrics.md)** - Comprehensive overview of all available benchmarks and evaluation metrics
481
+ - **[Overview of Dataloading](docs/overview_dataloading.md)** - Explanation of dataloading and task/sample/message structure
482
+
483
+ ### Scaling & Production
484
+
485
+ - **[Using Determined](docs/using_determined.md)** - Guide for distributed evaluation using Determined AI
486
+ - **[Controlling Upload Results](docs/controlling_upload_results.md)** - How to manage and control the upload of evaluation results
487
+
488
+ ### Citation
489
+
490
+ If you use `eval-framework` in your research, please cite:
491
+
492
+ ```bibtex
493
+ @software{eval_framework,
494
+ title={Aleph Alpha Eval Framework},
495
+ year={2025},
496
+ url={https://github.com/Aleph-Alpha-Research/eval-framework}
497
+ }
498
+ ```
499
+
500
+ ### License
501
+
502
+ This project is licensed under the [Apache License 2.0](LICENSE).
503
+
504
+ <br><br>
505
+ ---
506
+
507
+ This project has received funding from the European Union’s Digital Europe Programme under grant agreement No. 101195233 (OpenEuroLLM).
508
+
509
+ The contents of this publication are the sole responsibility of the OpenEuroLLM consortium and do not necessarily reflect the opinion of the European Union.
510
+
511
+ <p align="center">
512
+ <img src="docs/OELLM_1.png" alt="OELLM 1" width="100" style="margin-right: 50px;"/>
513
+ <img src="docs/OELLM_2.png" alt="OELLM 2" width="350"/>
514
+ </p>