eval-framework 0.9.1__tar.gz → 0.9.2__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.
- {eval_framework-0.9.1 → eval_framework-0.9.2}/PKG-INFO +2 -2
- {eval_framework-0.9.1 → eval_framework-0.9.2}/pyproject.toml +2 -2
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/code_assertion.py +2 -2
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/minerva_math_utils.py +9 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/response_generator.py +3 -1
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/base.py +5 -2
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/mbpp.py +1 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/registry.py +15 -5
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/utils.py +11 -1
- {eval_framework-0.9.1 → eval_framework-0.9.2}/LICENSE +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/README.md +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/__init__.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/base_config.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/context/__init__.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/context/determined.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/context/eval.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/context/local.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/evaluation_generator.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/exceptions.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/external/drop_process_results.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/external/ifeval_impl/README.md +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/external/ifeval_impl/instructions.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/external/ifeval_impl/instructions_registry.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/external/ifeval_impl/instructions_util.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/external/ifeval_impl/utils.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/llm/__init__.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/llm/aleph_alpha.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/llm/base.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/llm/huggingface.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/llm/models.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/llm/openai.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/logger.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/main.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/__init__.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/aggregators/__init__.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/aggregators/aggregators.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/base.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/__init__.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/accuracy_completion.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/code_execution_pass_at_one.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/concordance_index.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/csv_format.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/drop_completion.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/exponential_similarity.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/f1.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/format_checker.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/grid_difference.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/ifeval.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/json_format.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/language_checker.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/length_control.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/math_minerva_completion.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/math_reasoning_completion.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/multipl_e_assertion.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/placeholder_checker.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/repetition.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/rouge_1.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/rouge_2.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/rouge_geometric_mean.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/rouge_l.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/text_counter.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/efficiency/__init__.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/efficiency/bytes_per_sequence_position.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/__init__.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/base.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/graders/chatbot_style_grader.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/graders/coherence_grader.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/graders/comparison_grader.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/graders/conciseness_grader.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/graders/contains_names_grader.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/graders/format_correctness_grader.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/graders/instruction_grader.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/graders/language.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/graders/long_context_grader.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/graders/models.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/graders/refusal_grader.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/graders/sql_quality_grader.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/graders/summary_world_knowledge_grader.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/llm_judge_chatbot_style.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/llm_judge_coherence.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/llm_judge_completion_accuracy.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/llm_judge_conciseness.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/llm_judge_contains_names.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/llm_judge_format_correctness.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/llm_judge_instruction.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/llm_judge_mtbench_pair.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/llm_judge_mtbench_single.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/llm_judge_refusal.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/llm_judge_sql.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/llm_judge_world_knowledge.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/utils.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/loglikelihood/__init__.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/loglikelihood/accuracy_loglikelihood.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/loglikelihood/base.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/loglikelihood/bits_per_byte.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/loglikelihood/confidence_weighted_accuracy.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/loglikelihood/dcs.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/loglikelihood/probability_mass.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/loglikelihood/ternary.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/py.typed +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/result_processors/__init__.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/result_processors/base.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/result_processors/hf_uploader.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/result_processors/result_processor.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/result_processors/wandb_uploader.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/run.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/run_direct.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/shared/types.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/suite.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/Dockerfile_codebench +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/__init__.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/__init__.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/arc.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/arc_de.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/bigcodebench.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/copa.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/csqa.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/drop.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/global_mmlu.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/goldenswag.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/gpqa.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/gsm8k.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/hellaswag.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/humaneval.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/ifeval.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/math_reasoning.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/medqa.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/mmlu.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/mmlu_pro.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/multipl_e.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/naturalqs_open.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/piqa.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/sciq.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/social_iqa.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/squad.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/winogrande.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/dataset_revisions.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/eval_config.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/frozen-hf-dataset-revisions.json +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/hf-dataset-revisions.json +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/markdown_doc.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/perturbation.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/task_loader.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/task_names.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/task_style.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/utils/constants.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/utils/file_ops.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/utils/helpers.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/utils/logging.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/utils/packaging.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/utils/tqdm_handler.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/template_formatting/README.md +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/template_formatting/__init__.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/template_formatting/formatter.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/src/template_formatting/mistral_formatter.py +0 -0
- {eval_framework-0.9.1 → eval_framework-0.9.2}/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.9.
|
|
3
|
+
Version: 0.9.2
|
|
4
4
|
Summary: Evaluation Framework
|
|
5
5
|
Author: Aleph Alpha Research
|
|
6
6
|
License: Apache License
|
|
@@ -216,7 +216,7 @@ Requires-Dist: xmltodict>=1.0.4,<1.1
|
|
|
216
216
|
Requires-Dist: pydantic>=2.13.4,<3
|
|
217
217
|
Requires-Dist: datasets>=5.0.1,<6
|
|
218
218
|
Requires-Dist: pycountry>=26.2.16,<27
|
|
219
|
-
Requires-Dist: nltk>=3.10.
|
|
219
|
+
Requires-Dist: nltk>=3.10.2,<4
|
|
220
220
|
Requires-Dist: python-dotenv>=1.2.2,<2
|
|
221
221
|
Requires-Dist: lingua-language-detector>=2.2.0,<3
|
|
222
222
|
Requires-Dist: google-crc32c>=1.8.0,<2
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "eval-framework"
|
|
3
|
-
version = "0.9.
|
|
3
|
+
version = "0.9.2"
|
|
4
4
|
description = "Evaluation Framework"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = { file = "LICENSE" }
|
|
@@ -23,7 +23,7 @@ dependencies = [
|
|
|
23
23
|
"pydantic>=2.13.4,<3",
|
|
24
24
|
"datasets>=5.0.1,<6",
|
|
25
25
|
"pycountry>=26.2.16,<27",
|
|
26
|
-
"nltk>=3.10.
|
|
26
|
+
"nltk>=3.10.2,<4",
|
|
27
27
|
"python-dotenv>=1.2.2,<2",
|
|
28
28
|
"lingua-language-detector>=2.2.0,<3",
|
|
29
29
|
"google-crc32c>=1.8.0,<2",
|
|
@@ -2,7 +2,7 @@ from llm_sandbox.exceptions import SandboxTimeoutError
|
|
|
2
2
|
|
|
3
3
|
from eval_framework.metrics.base import BaseMetric, MetricResult
|
|
4
4
|
from eval_framework.shared.types import Completion
|
|
5
|
-
from eval_framework.tasks.utils import run_python_code
|
|
5
|
+
from eval_framework.tasks.utils import DockerReturnedEmptyOutput, run_python_code
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class CodeCompletionAssertion(BaseMetric[Completion]):
|
|
@@ -16,7 +16,7 @@ class CodeCompletionAssertion(BaseMetric[Completion]):
|
|
|
16
16
|
code = response.completion
|
|
17
17
|
try:
|
|
18
18
|
output = run_python_code(code, image="python:3.12-slim", runtime_configs={"mem_limit": "512m"})
|
|
19
|
-
except SandboxTimeoutError:
|
|
19
|
+
except (SandboxTimeoutError, DockerReturnedEmptyOutput):
|
|
20
20
|
# The submitted code timed out (e.g. an infinite loop) -- a failing sample, not an infra
|
|
21
21
|
# problem.
|
|
22
22
|
import traceback
|
|
@@ -350,8 +350,17 @@ def strip_string_hendrycks(string: str) -> str:
|
|
|
350
350
|
return string
|
|
351
351
|
|
|
352
352
|
|
|
353
|
+
# MATH gold answers stay under ~80 chars.
|
|
354
|
+
_PLAUSIBLE_ANSWER_LEN = 128
|
|
355
|
+
|
|
356
|
+
|
|
353
357
|
def is_equiv_minerva(x1: str, x2: str, timeout_seconds: int = 5) -> bool:
|
|
354
358
|
"""Sympy-based equivalence (Minerva)."""
|
|
359
|
+
# extract_answers can fall back to the whole completion; sympy grinds on such
|
|
360
|
+
# 1000+ char strings until the timeout. A side far longer than the other can't
|
|
361
|
+
# be an equivalent final answer, so refuse it before parsing.
|
|
362
|
+
if max(len(x1), len(x2)) > max(_PLAUSIBLE_ANSWER_LEN, 3 * min(len(x1), len(x2))):
|
|
363
|
+
return False
|
|
355
364
|
|
|
356
365
|
def _timeout_handler(signum: Any, frame: Any) -> None:
|
|
357
366
|
raise TimeoutError()
|
|
@@ -26,7 +26,7 @@ from eval_framework.shared.types import (
|
|
|
26
26
|
Loglikelihood,
|
|
27
27
|
RawLoglikelihood,
|
|
28
28
|
)
|
|
29
|
-
from eval_framework.tasks.base import Language, ResponseType, Sample
|
|
29
|
+
from eval_framework.tasks.base import RANDOM_SEED, 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
|
|
@@ -67,6 +67,7 @@ class ResponseGenerator:
|
|
|
67
67
|
config.task_subjects,
|
|
68
68
|
config.hf_revision,
|
|
69
69
|
user_prompt_suffix=config.user_prompt_suffix,
|
|
70
|
+
seed=RANDOM_SEED,
|
|
70
71
|
)
|
|
71
72
|
else:
|
|
72
73
|
self.task = registry()[config.task_name].create(
|
|
@@ -74,6 +75,7 @@ class ResponseGenerator:
|
|
|
74
75
|
config.task_subjects,
|
|
75
76
|
config.hf_revision,
|
|
76
77
|
user_prompt_suffix=config.user_prompt_suffix,
|
|
78
|
+
seed=RANDOM_SEED,
|
|
77
79
|
)
|
|
78
80
|
|
|
79
81
|
self.response_type = self.task.get_response_type()
|
|
@@ -147,6 +147,7 @@ class BaseTask[SubjectType](Task):
|
|
|
147
147
|
self.stop_sequences: list[str] | None = None
|
|
148
148
|
self.max_tokens: int | None = None
|
|
149
149
|
self.hf_revision: str | None = self._apply_hf_revision()
|
|
150
|
+
self.rnd: random.Random | None = None
|
|
150
151
|
|
|
151
152
|
def _apply_hf_revision(self, custom_hf_revision: str | None = None) -> str | None:
|
|
152
153
|
# Precedence: CLI/config override > REVISION_LOCKFILE pin.
|
|
@@ -167,12 +168,13 @@ class BaseTask[SubjectType](Task):
|
|
|
167
168
|
custom_subjects: list[str] | None,
|
|
168
169
|
custom_hf_revision: str | None,
|
|
169
170
|
user_prompt_suffix: str | None = None,
|
|
171
|
+
seed: int | None = RANDOM_SEED,
|
|
170
172
|
) -> Self:
|
|
171
173
|
instance = cls(num_fewshot=num_fewshot)
|
|
172
174
|
if user_prompt_suffix is not None and instance.get_response_type() != ResponseType.COMPLETION:
|
|
173
175
|
raise ValueError("user_prompt_suffix is only supported for completion tasks.")
|
|
174
176
|
instance.user_prompt_suffix = user_prompt_suffix
|
|
175
|
-
|
|
177
|
+
instance.rnd = random.Random(seed)
|
|
176
178
|
# If custom subjects were provided during initialization, they take precedence over the class-level SUBJECTS.
|
|
177
179
|
filtered_subjects = instance._filter_task_subjects(custom_subjects=custom_subjects)
|
|
178
180
|
if filtered_subjects:
|
|
@@ -244,8 +246,8 @@ class BaseTask[SubjectType](Task):
|
|
|
244
246
|
)
|
|
245
247
|
|
|
246
248
|
def _shuffle_splits(self, hf_dataset: DatasetDict) -> dict[str, Any]:
|
|
249
|
+
assert self.rnd is not None, "Task RNG is unseeded; build tasks via `with_overwrite`."
|
|
247
250
|
dataset = {}
|
|
248
|
-
self.rnd = random.Random(RANDOM_SEED)
|
|
249
251
|
|
|
250
252
|
for split, data in hf_dataset.items():
|
|
251
253
|
if split not in [self.SAMPLE_SPLIT, self.FEWSHOT_SPLIT]:
|
|
@@ -413,6 +415,7 @@ class BaseTask[SubjectType](Task):
|
|
|
413
415
|
return None
|
|
414
416
|
|
|
415
417
|
def _sample_fewshot_examples(self, item: dict[str, Any]) -> list[dict]:
|
|
418
|
+
assert self.rnd is not None, "Task RNG is unseeded; build tasks via `with_overwrite`."
|
|
416
419
|
if self.FEWSHOT_SPLIT == self.SAMPLE_SPLIT:
|
|
417
420
|
# If the fewshot and sample splits are the same, we risk including the current eval item
|
|
418
421
|
# as a fewshot example (leaking the answer). To prevent this, sample one extra example,
|
|
@@ -102,6 +102,7 @@ class MBPP(BaseTask[str]):
|
|
|
102
102
|
return f"{BEGIN}\n" + target + f"\n{END}"
|
|
103
103
|
|
|
104
104
|
def _sample_fewshot_examples(self, item: dict[str, Any]) -> list[dict]:
|
|
105
|
+
assert self.rnd is not None
|
|
105
106
|
fewshot_examples = self.rnd.sample(self.dataset[self.FEWSHOT_SPLIT], self.num_fewshot)
|
|
106
107
|
return fewshot_examples
|
|
107
108
|
|
|
@@ -5,7 +5,7 @@ from abc import ABC, abstractmethod
|
|
|
5
5
|
from collections.abc import Generator, Iterator, Sequence
|
|
6
6
|
from typing import TYPE_CHECKING, Any
|
|
7
7
|
|
|
8
|
-
from eval_framework.tasks.base import BaseTask, ResponseType
|
|
8
|
+
from eval_framework.tasks.base import RANDOM_SEED, BaseTask, ResponseType
|
|
9
9
|
from eval_framework.tasks.perturbation import PerturbationConfig, create_perturbation_class
|
|
10
10
|
from template_formatting.formatter import BaseFormatter
|
|
11
11
|
|
|
@@ -62,6 +62,7 @@ class EvalFactory(ABC):
|
|
|
62
62
|
custom_subjects: list[str] | None,
|
|
63
63
|
custom_hf_revision: str | None,
|
|
64
64
|
user_prompt_suffix: str | None = None,
|
|
65
|
+
seed: int | None = None,
|
|
65
66
|
) -> BaseTask: ...
|
|
66
67
|
|
|
67
68
|
@abstractmethod
|
|
@@ -72,6 +73,7 @@ class EvalFactory(ABC):
|
|
|
72
73
|
custom_subjects: list[str] | None,
|
|
73
74
|
custom_hf_revision: str | None,
|
|
74
75
|
user_prompt_suffix: str | None = None,
|
|
76
|
+
seed: int | None = None,
|
|
75
77
|
) -> BaseTask: ...
|
|
76
78
|
|
|
77
79
|
@abstractmethod
|
|
@@ -115,12 +117,14 @@ class _Lazy(EvalFactory):
|
|
|
115
117
|
custom_subjects: list[str] | None,
|
|
116
118
|
custom_hf_revision: str | None,
|
|
117
119
|
user_prompt_suffix: str | None = None,
|
|
120
|
+
seed: int | None = None,
|
|
118
121
|
) -> BaseTask:
|
|
119
122
|
return self.task_class().with_overwrite(
|
|
120
123
|
num_fewshot=num_fewshot,
|
|
121
124
|
custom_subjects=custom_subjects,
|
|
122
125
|
custom_hf_revision=custom_hf_revision,
|
|
123
126
|
user_prompt_suffix=user_prompt_suffix,
|
|
127
|
+
seed=seed,
|
|
124
128
|
)
|
|
125
129
|
|
|
126
130
|
def create_perturbation(
|
|
@@ -130,6 +134,7 @@ class _Lazy(EvalFactory):
|
|
|
130
134
|
custom_subjects: list[str] | None,
|
|
131
135
|
custom_hf_revision: str | None,
|
|
132
136
|
user_prompt_suffix: str | None = None,
|
|
137
|
+
seed: int | None = None,
|
|
133
138
|
) -> BaseTask:
|
|
134
139
|
perturbation_task_class = create_perturbation_class(self.task_class(), perturbation_config)
|
|
135
140
|
return perturbation_task_class.with_overwrite(
|
|
@@ -137,6 +142,7 @@ class _Lazy(EvalFactory):
|
|
|
137
142
|
custom_subjects=custom_subjects,
|
|
138
143
|
custom_hf_revision=custom_hf_revision,
|
|
139
144
|
user_prompt_suffix=user_prompt_suffix,
|
|
145
|
+
seed=seed,
|
|
140
146
|
)
|
|
141
147
|
|
|
142
148
|
def response_type(self) -> ResponseType:
|
|
@@ -153,9 +159,9 @@ class _Lazy(EvalFactory):
|
|
|
153
159
|
|
|
154
160
|
def markdown_doc(self, formatters: Sequence[BaseFormatter]) -> str:
|
|
155
161
|
try:
|
|
156
|
-
task = self.create(num_fewshot=1, custom_subjects=None, custom_hf_revision=None)
|
|
162
|
+
task = self.create(num_fewshot=1, custom_subjects=None, custom_hf_revision=None, seed=RANDOM_SEED)
|
|
157
163
|
except (TypeError, ValueError, AssertionError):
|
|
158
|
-
task = self.create(num_fewshot=0, custom_subjects=None, custom_hf_revision=None)
|
|
164
|
+
task = self.create(num_fewshot=0, custom_subjects=None, custom_hf_revision=None, seed=RANDOM_SEED)
|
|
159
165
|
return task.markdown_doc(formatters)
|
|
160
166
|
|
|
161
167
|
|
|
@@ -178,12 +184,14 @@ class _Eager(EvalFactory):
|
|
|
178
184
|
custom_subjects: list[str] | None,
|
|
179
185
|
custom_hf_revision: str | None,
|
|
180
186
|
user_prompt_suffix: str | None = None,
|
|
187
|
+
seed: int | None = None,
|
|
181
188
|
) -> BaseTask:
|
|
182
189
|
return self._task.with_overwrite(
|
|
183
190
|
num_fewshot=num_fewshot,
|
|
184
191
|
custom_subjects=custom_subjects,
|
|
185
192
|
custom_hf_revision=custom_hf_revision,
|
|
186
193
|
user_prompt_suffix=user_prompt_suffix,
|
|
194
|
+
seed=seed,
|
|
187
195
|
)
|
|
188
196
|
|
|
189
197
|
def create_perturbation(
|
|
@@ -193,6 +201,7 @@ class _Eager(EvalFactory):
|
|
|
193
201
|
custom_subjects: list[str] | None,
|
|
194
202
|
custom_hf_revision: str | None,
|
|
195
203
|
user_prompt_suffix: str | None = None,
|
|
204
|
+
seed: int | None = None,
|
|
196
205
|
) -> BaseTask:
|
|
197
206
|
perturbation_task_class = create_perturbation_class(self._task, perturbation_config)
|
|
198
207
|
return perturbation_task_class.with_overwrite(
|
|
@@ -200,6 +209,7 @@ class _Eager(EvalFactory):
|
|
|
200
209
|
custom_subjects=custom_subjects,
|
|
201
210
|
custom_hf_revision=custom_hf_revision,
|
|
202
211
|
user_prompt_suffix=user_prompt_suffix,
|
|
212
|
+
seed=seed,
|
|
203
213
|
)
|
|
204
214
|
|
|
205
215
|
def response_type(self) -> ResponseType:
|
|
@@ -216,9 +226,9 @@ class _Eager(EvalFactory):
|
|
|
216
226
|
|
|
217
227
|
def markdown_doc(self, formatters: Sequence[BaseFormatter]) -> str:
|
|
218
228
|
try:
|
|
219
|
-
task = self.create(num_fewshot=1, custom_subjects=None, custom_hf_revision=None)
|
|
229
|
+
task = self.create(num_fewshot=1, custom_subjects=None, custom_hf_revision=None, seed=RANDOM_SEED)
|
|
220
230
|
except (TypeError, ValueError, AssertionError):
|
|
221
|
-
task = self.create(num_fewshot=0, custom_subjects=None, custom_hf_revision=None)
|
|
231
|
+
task = self.create(num_fewshot=0, custom_subjects=None, custom_hf_revision=None, seed=RANDOM_SEED)
|
|
222
232
|
return task.markdown_doc(formatters)
|
|
223
233
|
|
|
224
234
|
|
|
@@ -58,6 +58,7 @@ def get_or_create_pool(
|
|
|
58
58
|
lang: str = "python",
|
|
59
59
|
min_pool_size: int = 1,
|
|
60
60
|
max_pool_size: int = 1,
|
|
61
|
+
max_container_uses: int = 100,
|
|
61
62
|
runtime_configs: dict[str, str] | None = None,
|
|
62
63
|
) -> ContainerPoolManager:
|
|
63
64
|
assert image or dockerfile, "Either image or dockerfile must be provided"
|
|
@@ -65,7 +66,9 @@ def get_or_create_pool(
|
|
|
65
66
|
with _pools_lock:
|
|
66
67
|
if key not in _pools:
|
|
67
68
|
pool = create_pool_manager(
|
|
68
|
-
config=PoolConfig(
|
|
69
|
+
config=PoolConfig(
|
|
70
|
+
min_pool_size=min_pool_size, max_container_uses=max_container_uses, max_pool_size=max_pool_size
|
|
71
|
+
),
|
|
69
72
|
lang=lang,
|
|
70
73
|
image=image,
|
|
71
74
|
dockerfile=dockerfile,
|
|
@@ -105,6 +108,10 @@ def get_n_letters(n: int) -> list[str]:
|
|
|
105
108
|
return list(string.ascii_uppercase)[: max(0, n)]
|
|
106
109
|
|
|
107
110
|
|
|
111
|
+
class DockerReturnedEmptyOutput(Exception):
|
|
112
|
+
"""Raised when the docker returns an empty output."""
|
|
113
|
+
|
|
114
|
+
|
|
108
115
|
def run_python_code(
|
|
109
116
|
code: str,
|
|
110
117
|
image: str | None = None,
|
|
@@ -142,6 +149,9 @@ def run_python_code(
|
|
|
142
149
|
out = (output.stderr + output.stdout).strip()
|
|
143
150
|
if isinstance(out, bytes):
|
|
144
151
|
out = out.decode("utf-8")
|
|
152
|
+
|
|
153
|
+
if not out.strip():
|
|
154
|
+
raise DockerReturnedEmptyOutput("Docker returned an empty output.")
|
|
145
155
|
return out
|
|
146
156
|
|
|
147
157
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/external/drop_process_results.py
RENAMED
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/external/ifeval_impl/README.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/external/ifeval_impl/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/aggregators/__init__.py
RENAMED
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/aggregators/aggregators.py
RENAMED
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/csv_format.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/ifeval.py
RENAMED
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/json_format.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/repetition.py
RENAMED
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/rouge_1.py
RENAMED
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/rouge_2.py
RENAMED
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/rouge_l.py
RENAMED
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/completion/text_counter.py
RENAMED
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/efficiency/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/graders/language.py
RENAMED
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/graders/models.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/llm_judge_coherence.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/llm_judge_refusal.py
RENAMED
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/llm/llm_judge_sql.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/loglikelihood/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/loglikelihood/base.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/loglikelihood/dcs.py
RENAMED
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/metrics/loglikelihood/ternary.py
RENAMED
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/result_processors/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/result_processors/hf_uploader.py
RENAMED
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/result_processors/wandb_uploader.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/bigcodebench.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/global_mmlu.py
RENAMED
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/goldenswag.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/hellaswag.py
RENAMED
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/humaneval.py
RENAMED
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/math_reasoning.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/mmlu_pro.py
RENAMED
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/multipl_e.py
RENAMED
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/naturalqs_open.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/social_iqa.py
RENAMED
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/benchmarks/winogrande.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eval_framework-0.9.1 → eval_framework-0.9.2}/src/eval_framework/tasks/hf-dataset-revisions.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|