nvidia-scicode 25.8__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.
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,73 @@
1
+ framework:
2
+ name: scicode
3
+ pkg_name: scicode
4
+ full_name: SciCode Benchmark
5
+ description: SciCode is a challenging benchmark designed to evaluate the capabilities of LLMs in generating code for solving realistic scientific research problems.
6
+ url: https://github.com/scicode-bench/SciCode
7
+ source: https://gitlab-master.nvidia.com/dl/JoC/competitive_evaluation/core_evals_frameworks/SciCode
8
+
9
+ defaults:
10
+ command: >-
11
+ {% if target.api_endpoint.api_key is not none %}API_KEY=${{target.api_endpoint.api_key}}{% endif %}
12
+ scicode_eval --model {{target.api_endpoint.model_id}} --url {{target.api_endpoint.url}}
13
+ --output-dir {{config.output_dir}}
14
+ --log-dir {{config.output_dir}}/logs
15
+ {% if config.params.temperature is not none %}--temperature={{config.params.temperature}}{% endif %}
16
+ {% if config.params.limit_samples is not none %}--limit-samples={{config.params.limit_samples}}{% endif %}
17
+ --n-samples={{config.params.extra.n_samples}}
18
+ --extra-params top_p={{config.params.top_p}},timeout={{config.params.request_timeout}},max_tokens={{config.params.max_new_tokens}},max_retries={{config.params.max_retries}}
19
+ {% if config.params.extra.with_background %}--with-background {% endif %}
20
+ {% if config.params.extra.include_dev %}--include-dev{% endif %}
21
+ {% if config.params.extra.eval_threads is not none %}--eval-threads={{config.params.extra.eval_threads}}{% endif %}
22
+ config:
23
+ supported_endpoint_types:
24
+ - chat
25
+ params:
26
+ limit_samples: null
27
+ temperature: 0
28
+ max_new_tokens: 2048
29
+ top_p: 0.00001
30
+ request_timeout: 60
31
+ max_retries: 2
32
+ extra:
33
+ with_background: false
34
+ include_dev: false
35
+ n_samples: 1
36
+ eval_threads: null
37
+ target:
38
+ api_endpoint: # required to add: url, model_id, type
39
+ stream: false
40
+
41
+ evaluations:
42
+ - name: SciCode
43
+ description: >-
44
+ - SciCode is a challenging benchmark designed to evaluate the capabilities of LLMs in generating code for solving realistic scientific research problems.
45
+ - This variant does not include scientist-annotated background in the prompts.
46
+ defaults:
47
+ config:
48
+ type: "scicode"
49
+ - name: SciCode-Background
50
+ description: >-
51
+ - SciCode is a challenging benchmark designed to evaluate the capabilities of LLMs in generating code for solving realistic scientific research problems.
52
+ - This variant includes scientist-annotated background in the prompts.
53
+ defaults:
54
+ config:
55
+ type: "scicode_background"
56
+ params:
57
+ extra:
58
+ with_background: true
59
+ - name: AA-SciCode
60
+ description: >-
61
+ - SciCode is a challenging benchmark designed to evaluate the capabilities of LLMs in generating code for solving realistic scientific research problems.
62
+ - This variant mimicks setup used by Artificial Analysis in their Intelligence Benchmark (v2).
63
+ - It includes scientist-annotated background in the prompts and uses all available problems for evaluation (including "dev" set).
64
+ defaults:
65
+ config:
66
+ type: "aa_scicode"
67
+ params:
68
+ temperature: 0.0
69
+ max_new_tokens: 4096
70
+ extra:
71
+ with_background: true
72
+ include_dev: true
73
+ n_samples: 3
@@ -0,0 +1,28 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ import warnings
17
+ from nvidia_eval_commons.api.run import run_eval
18
+
19
+
20
+ def main():
21
+ warnings.warn(
22
+ "This command is deprecated and will be removed in the next release. Please use the `eval-factory` command instead.",
23
+ DeprecationWarning,
24
+ stacklevel=2,
25
+ )
26
+
27
+ # Add this `framework_entrypoint:main` as an entrypoint to `pyproject.toml`, example
28
+ run_eval()
@@ -0,0 +1,41 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ import json
17
+ import pathlib
18
+
19
+ from nvidia_eval_commons.api.api_dataclasses import EvaluationResult
20
+
21
+
22
+ def parse_output(output_dir: str) -> EvaluationResult:
23
+ output_path = list(pathlib.Path(output_dir).glob('*.json'))
24
+ assert len(output_path) == 1, f"Expected 1 output file, found {len(output_path)} ({output_path})"
25
+ output_path = output_path[0]
26
+ with open(output_path) as f:
27
+ results = json.load(f)
28
+ metrics = {}
29
+ for metric_type in ("steps", "problems"):
30
+ metric_name = metric_type + "_pass@1"
31
+ metrics[metric_name] = dict(
32
+ scores={
33
+ metric_name: dict(
34
+ value=results[metric_name],
35
+ stats={}
36
+ )
37
+ }
38
+ )
39
+
40
+ task_results = {"metrics": metrics}
41
+ return EvaluationResult(tasks={'scicode': task_results}, groups={'scicode': task_results})