eval-framework 0.8.1__tar.gz → 0.8.3__tar.gz

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 (159) hide show
  1. {eval_framework-0.8.1 → eval_framework-0.8.3}/PKG-INFO +6 -4
  2. {eval_framework-0.8.1 → eval_framework-0.8.3}/README.md +2 -0
  3. {eval_framework-0.8.1 → eval_framework-0.8.3}/pyproject.toml +7 -7
  4. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/evaluation_generator.py +1 -3
  5. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/language_checker.py +0 -6
  6. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/response_generator.py +5 -13
  7. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/base.py +32 -2
  8. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/mbpp.py +88 -0
  9. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/squad.py +37 -2
  10. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/triviaqa.py +1 -1
  11. eval_framework-0.8.3/src/eval_framework/tasks/markdown_doc.py +81 -0
  12. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/task_names.py +3 -0
  13. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/utils/generate_task_docs.py +6 -101
  14. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/utils/logging.py +2 -16
  15. eval_framework-0.8.3/src/eval_framework/utils/tqdm_handler.py +7 -0
  16. eval_framework-0.8.1/src/eval_framework/utils/tqdm_handler.py +0 -14
  17. {eval_framework-0.8.1 → eval_framework-0.8.3}/LICENSE +0 -0
  18. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/__init__.py +0 -0
  19. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/base_config.py +0 -0
  20. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/context/__init__.py +0 -0
  21. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/context/determined.py +0 -0
  22. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/context/eval.py +0 -0
  23. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/context/local.py +0 -0
  24. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/exceptions.py +0 -0
  25. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/external/drop_process_results.py +0 -0
  26. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/external/ifeval_impl/README.md +0 -0
  27. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/external/ifeval_impl/instructions.py +0 -0
  28. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/external/ifeval_impl/instructions_registry.py +0 -0
  29. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/external/ifeval_impl/instructions_util.py +0 -0
  30. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/external/ifeval_impl/utils.py +0 -0
  31. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/llm/__init__.py +0 -0
  32. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/llm/aleph_alpha.py +0 -0
  33. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/llm/base.py +0 -0
  34. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/llm/huggingface.py +0 -0
  35. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/llm/models.py +0 -0
  36. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/llm/openai.py +0 -0
  37. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/logger.py +0 -0
  38. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/main.py +0 -0
  39. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/__init__.py +0 -0
  40. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/aggregators/__init__.py +0 -0
  41. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/aggregators/aggregators.py +0 -0
  42. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/base.py +0 -0
  43. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/__init__.py +0 -0
  44. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/accuracy_completion.py +0 -0
  45. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/code_assertion.py +0 -0
  46. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/code_execution_pass_at_one.py +0 -0
  47. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/concordance_index.py +0 -0
  48. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/csv_format.py +0 -0
  49. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/drop_completion.py +0 -0
  50. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/exponential_similarity.py +0 -0
  51. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/f1.py +0 -0
  52. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/format_checker.py +0 -0
  53. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/grid_difference.py +0 -0
  54. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/ifeval.py +0 -0
  55. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/json_format.py +0 -0
  56. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/length_control.py +0 -0
  57. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/math_minerva_completion.py +0 -0
  58. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/math_reasoning_completion.py +0 -0
  59. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/minerva_math_utils.py +0 -0
  60. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/multipl_e_assertion.py +0 -0
  61. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/placeholder_checker.py +0 -0
  62. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/repetition.py +0 -0
  63. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/rouge_1.py +0 -0
  64. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/rouge_2.py +0 -0
  65. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/rouge_geometric_mean.py +0 -0
  66. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/rouge_l.py +0 -0
  67. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/completion/text_counter.py +0 -0
  68. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/efficiency/__init__.py +0 -0
  69. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/efficiency/bytes_per_sequence_position.py +0 -0
  70. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/__init__.py +0 -0
  71. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/base.py +0 -0
  72. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/graders/chatbot_style_grader.py +0 -0
  73. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/graders/coherence_grader.py +0 -0
  74. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/graders/comparison_grader.py +0 -0
  75. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/graders/conciseness_grader.py +0 -0
  76. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/graders/contains_names_grader.py +0 -0
  77. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/graders/format_correctness_grader.py +0 -0
  78. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/graders/instruction_grader.py +0 -0
  79. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/graders/language.py +0 -0
  80. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/graders/long_context_grader.py +0 -0
  81. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/graders/models.py +0 -0
  82. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/graders/refusal_grader.py +0 -0
  83. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/graders/sql_quality_grader.py +0 -0
  84. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/graders/summary_world_knowledge_grader.py +0 -0
  85. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/llm_judge_chatbot_style.py +0 -0
  86. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/llm_judge_coherence.py +0 -0
  87. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/llm_judge_completion_accuracy.py +0 -0
  88. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/llm_judge_conciseness.py +0 -0
  89. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/llm_judge_contains_names.py +0 -0
  90. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/llm_judge_format_correctness.py +0 -0
  91. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/llm_judge_instruction.py +0 -0
  92. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/llm_judge_mtbench_pair.py +0 -0
  93. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/llm_judge_mtbench_single.py +0 -0
  94. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/llm_judge_refusal.py +0 -0
  95. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/llm_judge_sql.py +0 -0
  96. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/llm_judge_world_knowledge.py +0 -0
  97. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/llm/utils.py +0 -0
  98. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/loglikelihood/__init__.py +0 -0
  99. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/loglikelihood/accuracy_loglikelihood.py +0 -0
  100. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/loglikelihood/base.py +0 -0
  101. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/loglikelihood/bits_per_byte.py +0 -0
  102. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/loglikelihood/confidence_weighted_accuracy.py +0 -0
  103. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/loglikelihood/dcs.py +0 -0
  104. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/loglikelihood/probability_mass.py +0 -0
  105. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/metrics/loglikelihood/ternary.py +0 -0
  106. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/py.typed +0 -0
  107. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/result_processors/__init__.py +0 -0
  108. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/result_processors/base.py +0 -0
  109. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/result_processors/hf_uploader.py +0 -0
  110. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/result_processors/result_processor.py +0 -0
  111. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/result_processors/wandb_uploader.py +0 -0
  112. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/run.py +0 -0
  113. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/run_direct.py +0 -0
  114. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/shared/types.py +0 -0
  115. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/suite.py +0 -0
  116. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/Dockerfile_codebench +0 -0
  117. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/__init__.py +0 -0
  118. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/__init__.py +0 -0
  119. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/arc.py +0 -0
  120. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/arc_de.py +0 -0
  121. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/bigcodebench.py +0 -0
  122. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/copa.py +0 -0
  123. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/csqa.py +0 -0
  124. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/drop.py +0 -0
  125. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/global_mmlu.py +0 -0
  126. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/goldenswag.py +0 -0
  127. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/gpqa.py +0 -0
  128. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/gsm8k.py +0 -0
  129. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/hellaswag.py +0 -0
  130. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/humaneval.py +0 -0
  131. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/ifeval.py +0 -0
  132. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/math_reasoning.py +0 -0
  133. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/medqa.py +0 -0
  134. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/mmlu.py +0 -0
  135. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/mmlu_pro.py +0 -0
  136. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/multipl_e.py +0 -0
  137. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/naturalqs_open.py +0 -0
  138. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/piqa.py +0 -0
  139. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/sciq.py +0 -0
  140. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/social_iqa.py +0 -0
  141. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/benchmarks/winogrande.py +0 -0
  142. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/dataset_revisions.py +0 -0
  143. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/eval_config.py +0 -0
  144. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/frozen-hf-dataset-revisions.json +0 -0
  145. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/hf-dataset-revisions.json +0 -0
  146. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/perturbation.py +0 -0
  147. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/registry.py +0 -0
  148. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/task_loader.py +0 -0
  149. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/task_style.py +0 -0
  150. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/tasks/utils.py +0 -0
  151. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/utils/constants.py +0 -0
  152. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/utils/file_ops.py +0 -0
  153. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/utils/helpers.py +0 -0
  154. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/eval_framework/utils/packaging.py +0 -0
  155. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/template_formatting/README.md +0 -0
  156. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/template_formatting/__init__.py +0 -0
  157. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/template_formatting/formatter.py +0 -0
  158. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/template_formatting/mistral_formatter.py +0 -0
  159. {eval_framework-0.8.1 → eval_framework-0.8.3}/src/template_formatting/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: eval-framework
3
- Version: 0.8.1
3
+ Version: 0.8.3
4
4
  Summary: Evaluation Framework
5
5
  Author: Aleph Alpha Research
6
6
  License: Apache License
@@ -229,10 +229,10 @@ Requires-Dist: sympy>=1.13.1,<2
229
229
  Requires-Dist: llm-sandbox[docker]==0.3.39
230
230
  Requires-Dist: jsonlines>=4,<5
231
231
  Requires-Dist: lxml>=6.1.1,<7
232
- Requires-Dist: python-iso639>=2026.4.20
232
+ Requires-Dist: python-iso639>=2026.7.23
233
233
  Requires-Dist: wandb>=0.28.1,<1
234
234
  Requires-Dist: boto3>=1.43.19,<2
235
- Requires-Dist: numpy>=2.2.6
235
+ Requires-Dist: numpy>=2.5.1
236
236
  Requires-Dist: antlr4-python3-runtime==4.11.0
237
237
  Requires-Dist: scipy>=1.18.0,<2
238
238
  Requires-Dist: accelerate ; extra == 'accelerate'
@@ -240,7 +240,7 @@ Requires-Dist: eval-framework[determined,api,openai,transformers,accelerate,opti
240
240
  Requires-Dist: aleph-alpha-client>=11.5.1 ; extra == 'api'
241
241
  Requires-Dist: determined>=0.38.1,<0.39 ; extra == 'determined'
242
242
  Requires-Dist: tensorboard==2.21.0 ; extra == 'determined'
243
- Requires-Dist: openai>=2.46.0,<3 ; extra == 'openai'
243
+ Requires-Dist: openai>=2.48.0,<3 ; extra == 'openai'
244
244
  Requires-Dist: tiktoken>=0.13.0,<1 ; extra == 'openai'
245
245
  Requires-Dist: transformers>=4.45.2,<5 ; extra == 'openai'
246
246
  Requires-Dist: transformers>=4.45.2,<5 ; extra == 'optional'
@@ -528,6 +528,8 @@ If you use `eval-framework` in your research, please cite:
528
528
 
529
529
  This project is licensed under the [Apache License 2.0](LICENSE).
530
530
 
531
+ The constituent tasks' datasets can be subject to specific, more restrictive license terms by third parties. By using `eval-framework` you agree to adhere to and be bound by such license terms in the individual case.
532
+
531
533
  <br><br>
532
534
  ---
533
535
 
@@ -267,6 +267,8 @@ If you use `eval-framework` in your research, please cite:
267
267
 
268
268
  This project is licensed under the [Apache License 2.0](LICENSE).
269
269
 
270
+ The constituent tasks' datasets can be subject to specific, more restrictive license terms by third parties. By using `eval-framework` you agree to adhere to and be bound by such license terms in the individual case.
271
+
270
272
  <br><br>
271
273
  ---
272
274
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "eval-framework"
3
- version = "0.8.1"
3
+ version = "0.8.3"
4
4
  description = "Evaluation Framework"
5
5
  readme = "README.md"
6
6
  license = { file = "LICENSE" }
@@ -36,10 +36,10 @@ dependencies = [
36
36
  "llm-sandbox[docker]==0.3.39",
37
37
  "jsonlines>=4,<5",
38
38
  "lxml>=6.1.1,<7",
39
- "python-iso639>=2026.4.20",
39
+ "python-iso639>=2026.7.23",
40
40
  "wandb>=0.28.1,<1",
41
41
  "boto3>=1.43.19,<2",
42
- "numpy>=2.2.6",
42
+ "numpy>=2.5.1",
43
43
  # is a dependency of sympy, but not explicitly listed in the requirements.txt
44
44
  # https://github.com/sympy/sympy/blob/0204fa34e8f6f6f8ccb4de01209be9a2345c9d6e/doc/src/contributing/dependencies.md?plain=1#L125
45
45
  "antlr4-python3-runtime==4.11.0",
@@ -54,7 +54,7 @@ determined = [
54
54
  ]
55
55
  api = ["aleph-alpha-client>=11.5.1"]
56
56
  openai = [
57
- "openai>=2.46.0,<3",
57
+ "openai>=2.48.0,<3",
58
58
  "tiktoken>=0.13.0,<1",
59
59
  "transformers>=4.45.2,<5",
60
60
  ]
@@ -88,11 +88,11 @@ dev = [
88
88
  "pytest-mock>=3.15.1",
89
89
  "pytest-xdist>=3.8.0,<4",
90
90
  "pytest-sugar>1.1,<2",
91
- "types-pyyaml>=6.0.12.20260518,<7",
91
+ "types-pyyaml>=6.0.12.20260724,<7",
92
92
  "types-python-dateutil>=2.9.0.20260716,<3",
93
93
  "types-requests>=2.33.0.20260712,<3",
94
94
  "plotly>=6.9.0,<7",
95
- "ruff>=0.15.22",
95
+ "ruff>=0.16.0",
96
96
  "pip-licenses>=5.5.5",
97
97
  ]
98
98
  flash-attn = [
@@ -101,7 +101,7 @@ flash-attn = [
101
101
  ]
102
102
 
103
103
  [build-system]
104
- requires = ["uv_build>=0.11.29,<0.11.30"]
104
+ requires = ["uv_build>=0.11.32,<0.11.33"]
105
105
  build-backend = "uv_build"
106
106
 
107
107
  [tool.uv.build-backend]
@@ -20,7 +20,7 @@ from eval_framework.tasks.base import ResponseType
20
20
  from eval_framework.tasks.eval_config import EvalConfig
21
21
  from eval_framework.tasks.registry import registry
22
22
  from eval_framework.utils.constants import RED, RESET
23
- from eval_framework.utils.tqdm_handler import get_disable_bar_flag, safe_tqdm_write
23
+ from eval_framework.utils.tqdm_handler import get_disable_bar_flag
24
24
 
25
25
  logger = logging.getLogger(__name__)
26
26
 
@@ -79,7 +79,6 @@ class EvaluationGenerator:
79
79
  metric.fail_on_error = self.config.fail_on_error
80
80
 
81
81
  logger.info(f"Starting calculation of {metric.NAME}")
82
- safe_tqdm_write(f"INFO: Calculating {metric.NAME}")
83
82
  for response in tqdm(responses, desc=f"Calculating {metric.NAME}", disable=get_disable_bar_flag()):
84
83
  if f"{response.subject}_{response.id}_{metric.__class__.__name__}" in subject_result_id_existing:
85
84
  continue
@@ -117,7 +116,6 @@ class EvaluationGenerator:
117
116
  self.result_processor.save_metrics_result(result)
118
117
 
119
118
  logger.info(f"Completed calculation of {metric.NAME}")
120
- safe_tqdm_write(f"INFO: Completed {metric.NAME}")
121
119
 
122
120
  if not self.save_intermediate_results:
123
121
  self.result_processor.save_metrics_results(results)
@@ -41,9 +41,6 @@ class LanguageConsistencyChecker(BaseMetric[Completion]):
41
41
  if response.error is not None:
42
42
  return [MetricResult(metric_name=self.NAME, value=None, higher_is_better=True, error=response.error)]
43
43
 
44
- if not response.completion:
45
- return [] # No completion means no language to detect, so it is excluded from aggregation
46
-
47
44
  completion_language = response.get_completion_language()
48
45
  target_language = response.get_instruction_language()
49
46
  if completion_language == target_language == "":
@@ -60,9 +57,6 @@ class LanguageRawConsistencyChecker(BaseMetric[Completion]):
60
57
  if response.error is not None:
61
58
  return [MetricResult(metric_name=self.NAME, value=None, higher_is_better=True, error=response.error)]
62
59
 
63
- if not response.raw_completion:
64
- return [] # No completion means no language to detect, so it is excluded from aggregation
65
-
66
60
  raw_completion_language = response.get_raw_completion_language()
67
61
  target_language = response.get_instruction_language()
68
62
 
@@ -30,7 +30,7 @@ from eval_framework.tasks.base import Language, ResponseType, Sample
30
30
  from eval_framework.tasks.eval_config import EvalConfig
31
31
  from eval_framework.tasks.utils import raise_errors
32
32
  from eval_framework.utils.constants import RED, RESET
33
- from eval_framework.utils.tqdm_handler import get_disable_bar_flag, safe_tqdm_write
33
+ from eval_framework.utils.tqdm_handler import get_disable_bar_flag
34
34
 
35
35
  logger = logging.getLogger(__name__)
36
36
 
@@ -232,9 +232,7 @@ class ResponseGenerator:
232
232
  if not samples_batch:
233
233
  return
234
234
  if len(samples_batch) > 1:
235
- log_msg = "Processing batch..."
236
- logger.info(log_msg) # For log files
237
- safe_tqdm_write(log_msg) # For console display with tqdm
235
+ logger.info("Processing batch...")
238
236
 
239
237
  responses_batch = generative_output_function(samples_batch)
240
238
  responses.extend(responses_batch)
@@ -268,17 +266,13 @@ class ResponseGenerator:
268
266
  sample_index = i + 1
269
267
 
270
268
  if sample.id in subject_response_id_mapping.get(sample.subject, []):
271
- log_msg = (
269
+ logger.info(
272
270
  f"Task: {self.response_type.value}{subject} - Sample: {sample_index} - skipping, already done."
273
271
  )
274
- logger.info(log_msg) # For log files
275
- safe_tqdm_write(log_msg) # For console display with tqdm
276
272
  pbar.update(1)
277
273
  continue
278
274
 
279
- log_msg = f"Task: {self.response_type.value}{subject} - Sample: {sample_index}/{total_num_samples}"
280
- logger.info(log_msg) # For log files
281
- safe_tqdm_write(log_msg) # For console display with tqdm
275
+ logger.info(f"Task: {self.response_type.value}{subject} - Sample: {sample_index}/{total_num_samples}")
282
276
  pbar.set_postfix_str(f"Sample {sample_index}/{total_num_samples}")
283
277
  pbar.update(1)
284
278
 
@@ -289,9 +283,7 @@ class ResponseGenerator:
289
283
  samples_batch = []
290
284
 
291
285
  if should_preempt_callable():
292
- log_msg = "Preempt"
293
- logger.info(log_msg) # For log files
294
- safe_tqdm_write(log_msg) # For console display with tqdm
286
+ logger.info("Preempt")
295
287
  if not self.save_intermediate_results:
296
288
  self.result_processor.save_responses(responses)
297
289
  return responses, True
@@ -3,7 +3,7 @@ import os
3
3
  import random
4
4
  import traceback
5
5
  from abc import ABC
6
- from collections.abc import Iterable
6
+ from collections.abc import Iterable, Sequence
7
7
  from enum import Enum
8
8
  from pathlib import Path
9
9
  from typing import TYPE_CHECKING, Any, Self, TypeVar
@@ -14,8 +14,9 @@ from pydantic import BaseModel, ConfigDict
14
14
 
15
15
  from eval_framework.shared.types import BaseMetricContext, Completion, Error, RawCompletion
16
16
  from eval_framework.tasks.dataset_revisions import pinned_revision
17
+ from eval_framework.tasks.markdown_doc import markdown_doc as render_markdown_doc
17
18
  from eval_framework.tasks.utils import classproperty, raise_errors
18
- from template_formatting.formatter import Message, Role
19
+ from template_formatting.formatter import BaseFormatter, Message, Role
19
20
 
20
21
  if TYPE_CHECKING:
21
22
  from eval_framework.llm.base import BaseLLM
@@ -280,6 +281,35 @@ class BaseTask[SubjectType](ABC):
280
281
  done = True
281
282
  break
282
283
 
284
+ def markdown_doc(self, formatters: Sequence[BaseFormatter]) -> str:
285
+ """Render this task's documentation as markdown."""
286
+ dataset_path = getattr(self, "DATASET_PATH", None)
287
+ example_messages = split_sizes = possible_completions = ground_truth = None
288
+ if dataset_path is None:
289
+ sample = next(iter(self.iterate_samples(1)))
290
+ example_messages = sample.messages
291
+ split_sizes = {split: len(self.dataset[split]) for split in self.dataset}
292
+ possible_completions = sample.possible_completions
293
+ ground_truth = sample.ground_truth
294
+
295
+ return render_markdown_doc(
296
+ name=self.NAME,
297
+ module=type(self).__module__,
298
+ dataset_path=dataset_path,
299
+ sample_split=getattr(self, "SAMPLE_SPLIT", None),
300
+ fewshot_split=getattr(self, "FEWSHOT_SPLIT", None),
301
+ response_type=self.get_response_type().name,
302
+ metrics=[m.__name__ for m in self.get_metrics()],
303
+ subjects=getattr(self, "SUBJECTS", None),
304
+ language=getattr(self, "LANGUAGE", None),
305
+ num_fewshot=self.num_fewshot,
306
+ formatters=formatters,
307
+ example_messages=example_messages,
308
+ split_sizes=split_sizes,
309
+ possible_completions=possible_completions,
310
+ ground_truth=ground_truth,
311
+ )
312
+
283
313
  def _create_samples(self, item: dict[str, Any], index: int, subject: str) -> list[Sample]:
284
314
  """Creates one or more samples from a single dataset item. Default implementation returns single sample."""
285
315
  return [
@@ -10,6 +10,7 @@ from eval_framework.metrics.loglikelihood.bits_per_byte import BitsPerByteLoglik
10
10
  from eval_framework.shared.types import BaseMetricContext
11
11
  from eval_framework.tasks.base import BaseTask, Language, ResponseType, Sample
12
12
  from eval_framework.tasks.dataset_revisions import HF_REVISIONS_LOCKFILE
13
+ from eval_framework.tasks.task_style import BPBStyle
13
14
 
14
15
  logger = logging.getLogger(__name__)
15
16
 
@@ -314,3 +315,90 @@ class MBPP_OLMES(MBPP):
314
315
  mbpp_ground_truth = str(sample.ground_truth)
315
316
  code = self._code_expander(extracted_code, mbpp_ground_truth)
316
317
  return code
318
+
319
+
320
+ class MBPP_EvalPlus(MBPP):
321
+ """Version that faithfully follows the EvalPlus prompt format, which OLMES only approximated."""
322
+
323
+ REVISION_LOCKFILE = HF_REVISIONS_LOCKFILE
324
+
325
+ NAME = "MBPP_EvalPlus"
326
+ FEWSHOT_SPLIT = "test"
327
+
328
+ def __init__(self, num_fewshot: int = 3) -> None:
329
+ super().__init__(num_fewshot)
330
+ if num_fewshot != 3:
331
+ logger.warning(f"MBPP_EvalPlus supports only 3-shot, got {num_fewshot}")
332
+ self.stop_sequences = ["```", "\nassert", "\nPlease provide"]
333
+
334
+ def _get_instruction_text(self, item: dict[str, Any]) -> str:
335
+ text = item["text"] if "text" in item else item["prompt"]
336
+ test = item["test_list"][0]
337
+ return (
338
+ "Please provide a self-contained Python script that solves the following problem"
339
+ f" in a markdown code block:\n```\n{text.strip()}\n{test}\n```\n"
340
+ )
341
+
342
+ def _get_cue_text(self, item: dict[str, Any]) -> str:
343
+ return (
344
+ "Below is a Python script with a self-contained function that solves the problem"
345
+ " and passes corresponding tests:\n```python"
346
+ )
347
+
348
+ def _get_fewshot_target_text(self, item: dict[str, Any]) -> str:
349
+ # The cue ends at ```python (no trailing newline, since it is stripped as the final eval
350
+ # message); the fewshot target adds the newline before the code explicitly.
351
+ return self._get_cue_text(item) + "\n" + item["code"] + "\n```"
352
+
353
+ def _sample_fewshot_examples(self, item: dict[str, Any]) -> list[dict]:
354
+ return list(_OLMES_FEWSHOT_EXAMPLES)
355
+
356
+ def post_process_generated_completion(self, completion_text: str, sample: Sample) -> str: # type: ignore[override]
357
+ extracted_code = completion_text + "\n"
358
+ mbpp_ground_truth = str(sample.ground_truth)
359
+ code = self._code_expander(extracted_code, mbpp_ground_truth)
360
+ return code
361
+
362
+
363
+ class MBPP_BPB_EvalPlus(BaseTask[str]):
364
+ """BPB (loglikelihood) counterpart of MBPP_EvalPlus."""
365
+
366
+ REVISION_LOCKFILE = HF_REVISIONS_LOCKFILE
367
+
368
+ NAME = "MBPP_BPB_EvalPlus"
369
+ DATASET_PATH = "google-research-datasets/mbpp"
370
+ SAMPLE_SPLIT = "test"
371
+ FEWSHOT_SPLIT = "test"
372
+ SUBJECTS = ["full"]
373
+ LANGUAGE = Language.ENG
374
+ TASK_STYLER = BPBStyle(
375
+ question_prefix="",
376
+ trailing_newline=False,
377
+ cue_text=(
378
+ "Below is a Python script with a self-contained function that solves the problem"
379
+ f" and passes corresponding tests:\n{BEGIN}"
380
+ ),
381
+ leading_space_continuations=False,
382
+ )
383
+
384
+ def __init__(self, num_fewshot: int = 3) -> None:
385
+ super().__init__(num_fewshot)
386
+ if num_fewshot != 3:
387
+ logger.warning(f"MBPP_BPB_EvalPlus supports only 3-shot, got {num_fewshot}")
388
+
389
+ def _get_raw_question(self, item: dict[str, Any]) -> str:
390
+ text = item["text"] if "text" in item else item["prompt"]
391
+ test = item["test_list"][0]
392
+ return (
393
+ "Please provide a self-contained Python script that solves the following problem"
394
+ f" in a markdown code block:\n```\n{text.strip()}\n{test}\n```\n"
395
+ )
396
+
397
+ def _get_choices(self, item: dict[str, Any]) -> list[str]:
398
+ return ["\n" + item["code"] + f"\n{END}"]
399
+
400
+ def _get_correct_index(self, item: dict[str, Any]) -> int:
401
+ return 0
402
+
403
+ def _sample_fewshot_examples(self, item: dict[str, Any]) -> list[dict]:
404
+ return list(_OLMES_FEWSHOT_EXAMPLES)
@@ -11,7 +11,7 @@ from huggingface_hub.errors import RevisionNotFoundError
11
11
  from eval_framework.metrics.completion.accuracy_completion import AccuracyCompletion
12
12
  from eval_framework.metrics.completion.f1 import F1, F1SquadNormalized
13
13
  from eval_framework.metrics.loglikelihood.bits_per_byte import BitsPerByteLoglikelihood
14
- from eval_framework.tasks.base import NO_SUBJECT, RANDOM_SEED, BaseTask, Language, ResponseType, SubjectType
14
+ from eval_framework.tasks.base import NO_SUBJECT, RANDOM_SEED, BaseTask, Language, ResponseType, Sample, SubjectType
15
15
  from eval_framework.tasks.dataset_revisions import HF_REVISIONS_LOCKFILE
16
16
 
17
17
 
@@ -252,7 +252,7 @@ class SQuAD2_MA(SQUAD2):
252
252
  def __init__(self, num_fewshot: int = 0) -> None:
253
253
  super().__init__(num_fewshot)
254
254
  self.stop_sequences = []
255
- self.max_tokens = None
255
+ self.max_tokens = 10_000
256
256
 
257
257
  def _get_system_prompt_text(self, item: dict[str, Any]) -> str | None:
258
258
  return (
@@ -261,11 +261,46 @@ class SQuAD2_MA(SQUAD2):
261
261
  "Use the given context to answer the question faithfully. Answer only if the "
262
262
  f"answer is present in the given context, otherwise respond with '{self.UNANSWERABLE_STR}' "
263
263
  "if the answer is not present in the context."
264
+ "Always begin your answer with 'Final answer:'"
264
265
  )
265
266
 
266
267
  def _get_instruction_text(self, item: dict[str, Any]) -> str:
267
268
  return f"Context:\n{item['context']}\n\nQuestion:\n{item['question']}\n"
268
269
 
270
+ def post_process_generated_completion(self, completion_text: str, sample: Sample | None = None) -> str:
271
+ """Clean up the generated answer."""
272
+ # Remove common prefixes and clean whitespace
273
+ cleaned = completion_text.strip()
274
+ common_prefixes = ["Answer", "Final answer"]
275
+ # A list comprehension (not a generator) is required here: list.extend
276
+ # consumes lazily, so a generator over the list being extended never
277
+ # terminates and grows the list unboundedly until OOM.
278
+ common_prefixes.extend([f"**{prefix}**" for prefix in common_prefixes])
279
+ common_prefixes.reverse()
280
+
281
+ # Search for the last occurrence of any common prefix, and take only what's after it.
282
+ for prefix in common_prefixes:
283
+ idx = cleaned.rfind(prefix + ":")
284
+ if idx != -1:
285
+ cleaned = cleaned[idx + len(prefix) + 1 :].strip()
286
+ break
287
+ return cleaned
288
+
289
+ def _get_ground_truth(self, item: dict[str, Any]) -> list[str]:
290
+ text_ = item["answers"]["text"]
291
+ ground_truth_for_unanswerable = [
292
+ self.UNANSWERABLE_STR,
293
+ self.UNANSWERABLE_STR + " ",
294
+ self.UNANSWERABLE_STR.capitalize(),
295
+ ]
296
+ ground_truths = text_ if text_ else ground_truth_for_unanswerable
297
+ return ground_truths
298
+
299
+
300
+ class SQuAD2_MA_NO_SYSPROMPT(SQuAD2_MA):
301
+ def _get_system_prompt_text(self, item: dict[str, Any]) -> str | None:
302
+ return ""
303
+
269
304
 
270
305
  class SQuAD_OLMES(SQUAD):
271
306
  """SQuAD variant matching OLMES implementation."""
@@ -60,7 +60,7 @@ class TriviaQA_MA(TRIVIAQA):
60
60
  def __init__(self, num_fewshot: int = 0) -> None:
61
61
  super().__init__(num_fewshot)
62
62
  self.stop_sequences = []
63
- self.max_tokens = None
63
+ self.max_tokens = 27_000
64
64
 
65
65
  def _get_context_text(self, item: dict[str, Any]) -> str:
66
66
  return "\n\n".join(item["entity_pages"]["wiki_context"])
@@ -0,0 +1,81 @@
1
+ from collections.abc import Sequence
2
+ from io import StringIO
3
+ from typing import Any
4
+
5
+ from template_formatting.formatter import BaseFormatter, Message
6
+
7
+
8
+ def markdown_doc(
9
+ *,
10
+ name: str,
11
+ module: str,
12
+ dataset_path: str | None,
13
+ sample_split: str | None,
14
+ fewshot_split: str | None,
15
+ response_type: str,
16
+ metrics: Sequence[str],
17
+ subjects: Any,
18
+ language: Any,
19
+ num_fewshot: int,
20
+ formatters: Sequence[BaseFormatter],
21
+ example_messages: list[Message] | None,
22
+ split_sizes: dict[str, int] | None,
23
+ possible_completions: str | list[str] | None,
24
+ ground_truth: str | list[str] | None,
25
+ ) -> str:
26
+ """Render a task's documentation as markdown"""
27
+ buf = StringIO()
28
+ buf.write(f"# {name}\n\n")
29
+ http_path = f"https://huggingface.co/datasets/{dataset_path}" if dataset_path else None
30
+
31
+ buf.write("````\n") # fence with 4 thicks because some prompts have code blocks with 3 thicks
32
+ buf.write(f"NAME = {name}".strip() + "\n")
33
+ if dataset_path is not None:
34
+ buf.write(f"DATASET_PATH = {dataset_path}".strip() + "\n")
35
+ if sample_split is not None:
36
+ buf.write(f"SAMPLE_SPLIT = {sample_split}".strip() + "\n")
37
+ if fewshot_split is not None:
38
+ buf.write(f"FEWSHOT_SPLIT = {fewshot_split}".strip() + "\n")
39
+ buf.write(f"RESPONSE_TYPE = {response_type}".strip() + "\n")
40
+ buf.write(f"METRICS = [{', '.join(metrics)}]".strip() + "\n")
41
+ if subjects is not None:
42
+ buf.write(f"SUBJECTS = {subjects!r}".strip() + "\n")
43
+ if language is not None:
44
+ buf.write(f"LANGUAGE = {language!r}".strip() + "\n")
45
+ buf.write("````\n\n")
46
+
47
+ buf.write(f"- Module: `{module}`\n\n")
48
+
49
+ if http_path:
50
+ buf.write(f"- Link to dataset: [{http_path}]({http_path})\n\n")
51
+ else:
52
+ assert example_messages is not None, "a task without a dataset link must supply an example sample"
53
+ for split, size in (split_sizes or {}).items():
54
+ buf.write(f"- `{split}` has {size} samples\n\n")
55
+
56
+ for formatter in formatters:
57
+ buf.write(f"## Example prompt with {formatter.__class__.__name__} ({num_fewshot}-shot)\n\n")
58
+ formatted_sample = formatter.format(example_messages, output_mode="string")
59
+ buf.write("````\n")
60
+ buf.write(f'"{formatted_sample}"')
61
+ buf.write("\n````\n\n")
62
+
63
+ buf.write("## Possible completions:\n\n")
64
+ buf.write("````\n")
65
+ if possible_completions:
66
+ for item in possible_completions if isinstance(possible_completions, list) else [possible_completions]:
67
+ buf.write(f'- "{item}"\n')
68
+ else:
69
+ buf.write("None\n")
70
+ buf.write("````\n\n")
71
+
72
+ buf.write("## Ground truth:\n\n")
73
+ buf.write("````\n")
74
+ if ground_truth:
75
+ for item in ground_truth if isinstance(ground_truth, list) else [ground_truth]:
76
+ buf.write(f'- "{item}"\n')
77
+ else:
78
+ buf.write("None\n")
79
+ buf.write("````\n")
80
+
81
+ return buf.getvalue()
@@ -51,6 +51,8 @@ def register_all_tasks() -> None:
51
51
  register_lazy_task("eval_framework.tasks.benchmarks.multipl_e.MultiPLEMBPPSh")
52
52
  register_lazy_task("eval_framework.tasks.benchmarks.mbpp.MBPPBPB")
53
53
  register_lazy_task("eval_framework.tasks.benchmarks.mbpp.MBPP_OLMES")
54
+ register_lazy_task("eval_framework.tasks.benchmarks.mbpp.MBPP_EvalPlus")
55
+ register_lazy_task("eval_framework.tasks.benchmarks.mbpp.MBPP_BPB_EvalPlus")
54
56
  register_lazy_task("eval_framework.tasks.benchmarks.mmlu.MMLU")
55
57
  register_lazy_task("eval_framework.tasks.benchmarks.mmlu.MMLU_IDK")
56
58
  register_lazy_task("eval_framework.tasks.benchmarks.mmlu.MMLU_OLMES")
@@ -68,6 +70,7 @@ def register_all_tasks() -> None:
68
70
  register_lazy_task("eval_framework.tasks.benchmarks.sciq.SCIQ_OLMES")
69
71
  register_lazy_task("eval_framework.tasks.benchmarks.squad.SQuAD_OLMES")
70
72
  register_lazy_task("eval_framework.tasks.benchmarks.squad.SQuAD2_MA")
73
+ register_lazy_task("eval_framework.tasks.benchmarks.squad.SQuAD2_MA_NO_SYSPROMPT")
71
74
  register_lazy_task("eval_framework.tasks.benchmarks.triviaqa.TRIVIAQA")
72
75
  register_lazy_task("eval_framework.tasks.benchmarks.triviaqa.TriviaQA_MA")
73
76
  register_lazy_task("eval_framework.tasks.benchmarks.winogrande.WINOGRANDECloze")
@@ -1,7 +1,5 @@
1
1
  import argparse
2
- import inspect
3
2
  import os
4
- import re
5
3
  from pathlib import Path
6
4
 
7
5
  import tqdm
@@ -27,7 +25,7 @@ def parse_args(cli_args: list[str] | None = None) -> argparse.Namespace:
27
25
  action="store_true",
28
26
  default=False,
29
27
  required=False,
30
- help="If set, examples prompts for each of the formatters will be added in the generated docs.",
28
+ help="Unused. Only there for backwards compatibility",
31
29
  )
32
30
  parser.add_argument(
33
31
  "--exclude-tasks",
@@ -65,108 +63,16 @@ def parse_args(cli_args: list[str] | None = None) -> argparse.Namespace:
65
63
  return parser.parse_args(args=cli_args)
66
64
 
67
65
 
68
- def generate_docs_for_task(
69
- output_docs_directory: Path, task_name: str, formatters: list[BaseFormatter], add_prompt_examples: bool
70
- ) -> None:
66
+ def generate_docs_for_task(output_docs_directory: Path, task_name: str, formatters: list[BaseFormatter]) -> None:
71
67
  """Generate documentation for a specific task."""
72
- eval_ = registry()[task_name]
73
- task_class = eval_.task_class()
68
+ task_class = registry()[task_name].task_class()
74
69
 
75
70
  try:
76
- num_fewshot = 1
77
- task = task_class(num_fewshot=num_fewshot)
71
+ task = task_class(num_fewshot=1)
78
72
  except (TypeError, ValueError, AssertionError):
79
- try:
80
- num_fewshot = 0
81
- task = task_class(num_fewshot=num_fewshot)
82
- except (TypeError, ValueError, AssertionError):
83
- try:
84
- task = task_class()
85
- num_fewshot = task.num_fewshot
86
- except Exception as e:
87
- print(f"Failed to instantiate task {task_name}: {e}")
88
- return
89
-
90
- with open(f"{output_docs_directory}/{task_name}.md", "w") as f:
91
- f.write(f"# {task_name}\n\n")
92
- dataset_path = eval_.dataset_path()
93
- http_path = f"https://huggingface.co/datasets/{dataset_path}" if dataset_path else None
94
-
95
- f.write("````\n") # fence with 4 thicks because some prompts have code blocks with 3 thicks
96
- f.write(f"NAME = {task_name}".strip() + "\n")
97
- if dataset_path is not None:
98
- f.write(f"DATASET_PATH = {dataset_path}".strip() + "\n")
99
- if hasattr(task, "SAMPLE_SPLIT"):
100
- f.write(f"SAMPLE_SPLIT = {task.SAMPLE_SPLIT}".strip() + "\n")
101
- if hasattr(task, "FEWSHOT_SPLIT"):
102
- f.write(f"FEWSHOT_SPLIT = {task.FEWSHOT_SPLIT}".strip() + "\n")
103
- f.write(f"RESPONSE_TYPE = {eval_.response_type().name}".strip() + "\n")
104
- metrics_list = [f"{m.__name__}" for m in eval_.metrics()]
105
- f.write(f"METRICS = [{', '.join(metrics_list)}]".strip() + "\n")
106
- if hasattr(task, "SUBJECTS"):
107
- f.write(f"SUBJECTS = {repr(task.SUBJECTS)}".strip() + "\n")
108
- if hasattr(task, "LANGUAGE"):
109
- f.write(f"LANGUAGE = {repr(task.LANGUAGE)}".strip() + "\n")
110
- f.write("````\n\n")
111
-
112
- f.write(f"- Module: `{task_class.__module__}`\n\n")
73
+ task = task_class(num_fewshot=0)
113
74
 
114
- try:
115
- raw_file_path = inspect.getfile(task_class)
116
- # Find the package root 'eval_framework' in the path
117
- match = re.search(r"eval_framework.*", raw_file_path)
118
- if match:
119
- # Reconstruct relative path assuming standard 'src' structure
120
- task_file = f"src/{match.group(0)}"
121
- # Provide a local relative link (for VS Code) and an absolute link (for GitHub/Web)
122
- f.write(f"- File: [{task_file}](../../{task_file}) | [View on GitHub]({REPO_URL}/{task_file})\n\n")
123
- else:
124
- # Fallback for tasks defined outside the main package (e.g., custom local tasks)
125
- f.write(f"- File: `{raw_file_path}`\n\n")
126
- except Exception:
127
- f.write("- File: `Dynamic or Built-in`\n\n")
128
-
129
- if http_path:
130
- f.write(f"- Link to dataset: [{http_path}]({http_path})\n\n")
131
-
132
- if not add_prompt_examples:
133
- f.write(
134
- f"More detailed documentation, with prompt examples and ground truth completions, can be generated "
135
- f"with `uv run -m eval_framework.utils.generate_task_docs --add-prompt-examples "
136
- f'--only-tasks "{task_name}"`.\n'
137
- )
138
-
139
- else:
140
- s = next(iter(task.iterate_samples(1)))
141
- for split in task.dataset:
142
- f.write(f"- `{split}` has {len(task.dataset[split])} samples\n\n")
143
-
144
- for formatter in formatters:
145
- f.write(f"## Example prompt with {formatter.__class__.__name__} ({num_fewshot}-shot)\n\n")
146
- formatted_sample = formatter.format(s.messages, output_mode="string")
147
- f.write("````\n")
148
- f.write(f'"{formatted_sample}"')
149
- f.write("\n````\n\n")
150
-
151
- f.write("## Possible completions:\n\n")
152
- f.write("````\n")
153
- if s.possible_completions:
154
- for item in (
155
- s.possible_completions if isinstance(s.possible_completions, list) else [s.possible_completions]
156
- ):
157
- f.write(f'- "{item}"\n')
158
- else:
159
- f.write("None\n")
160
- f.write("````\n\n")
161
-
162
- f.write("## Ground truth:\n\n")
163
- f.write("````\n")
164
- if s.ground_truth:
165
- for item in s.ground_truth if isinstance(s.ground_truth, list) else [s.ground_truth]:
166
- f.write(f'- "{item}"\n')
167
- else:
168
- f.write("None\n")
169
- f.write("````\n")
75
+ (output_docs_directory / f"{task_name}.md").write_text(task.markdown_doc(formatters), encoding="utf-8")
170
76
 
171
77
 
172
78
  def generate_readme_list(output_docs_directory: Path, total_tasks: int) -> None:
@@ -227,7 +133,6 @@ def generate_all_docs(args: argparse.Namespace, output_docs_directory: Path) ->
227
133
  output_docs_directory=output_docs_directory,
228
134
  task_name=task_name,
229
135
  formatters=formatters,
230
- add_prompt_examples=args.add_prompt_examples,
231
136
  )
232
137
 
233
138
  except Exception as e: