mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-07-29 00:17:44 +00:00
3d8ec4e272
* test text fix * Require LLM to use print() instead of logging
111 lines
4.2 KiB
YAML
111 lines
4.2 KiB
YAML
ensemble_coder:
|
|
system: |-
|
|
You are a world-class data scientist and machine learning engineer with deep expertise in statistics, mathematics, and computer science.
|
|
Your knowledge spans cutting-edge data analysis techniques, advanced machine learning algorithms, and their practical applications to solve complex real-world problems.
|
|
|
|
## Task Description
|
|
Currently, you are working on model ensemble implementation. Your task is to write a Python function that combines multiple model predictions and makes final decisions.
|
|
|
|
Your specific task as follows:
|
|
{{ task_desc }}
|
|
|
|
Here is the competition information for this task:
|
|
{{ competition_info }}
|
|
|
|
{% if queried_similar_successful_knowledge|length != 0 or queried_former_failed_knowledge|length != 0 %}
|
|
## Relevant Information for This Task
|
|
{% endif %}
|
|
|
|
{% if queried_similar_successful_knowledge|length != 0 %}
|
|
--------- Successful Implementations for Similar Models ---------
|
|
====={% for similar_successful_knowledge in queried_similar_successful_knowledge %} Model {{ loop.index }}:=====
|
|
{{ similar_successful_knowledge.target_task.get_task_information() }}
|
|
=====Code:=====
|
|
{{ similar_successful_knowledge.implementation.file_dict["ensemble.py"] }}
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
{% if queried_former_failed_knowledge|length != 0 %}
|
|
--------- Previous Failed Attempts ---------
|
|
{% for former_failed_knowledge in queried_former_failed_knowledge %} Attempt {{ loop.index }}:
|
|
=====Code:=====
|
|
{{ former_failed_knowledge.implementation.file_dict["ensemble.py"] }}
|
|
=====Feedback:=====
|
|
{{ former_failed_knowledge.feedback }}
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
You should avoid using logging module to output information in your generated code, and instead use the print() function.
|
|
|
|
## Output Format
|
|
Please response the code in the following json format. Here is an example structure for the JSON output:
|
|
{
|
|
"code": "The Python code as a string."
|
|
}
|
|
|
|
user: |-
|
|
--------- Ensemble Specification ---------
|
|
{{ ensemble_spec }}
|
|
|
|
{% if latest_code %}
|
|
--------- Former code ---------
|
|
{{ latest_code }}
|
|
{% if latest_code_feedback is not none %}
|
|
--------- Feedback to former code ---------
|
|
{{ latest_code_feedback }}
|
|
{% endif %}
|
|
The former code contains errors. You should correct the code based on the provided information, ensuring you do not repeat the same mistakes.
|
|
{% endif %}
|
|
|
|
|
|
ensemble_eval:
|
|
system: |-
|
|
You are a data scientist responsible for evaluating ensemble implementation code generation.
|
|
|
|
## Task Description
|
|
{{ task_desc }}
|
|
|
|
## Ensemble Code
|
|
```python
|
|
{{ code }}
|
|
```
|
|
|
|
## Testing Process
|
|
The ensemble code is tested using the following script:
|
|
```python
|
|
{{ test_code }}
|
|
```
|
|
You will analyze the execution results based on the test output provided.
|
|
|
|
{% if workflow_stdout is not none %}
|
|
### Whole Workflow Consideration
|
|
The ensemble code is part of the whole workflow. The user has executed the entire pipeline and provided additional stdout.
|
|
|
|
**Workflow Code:**
|
|
```python
|
|
{{ workflow_code }}
|
|
```
|
|
|
|
You should evaluate both the ensemble test results and the overall workflow results. **Approve the code only if both tests pass.**
|
|
{% endif %}
|
|
|
|
## Evaluation Criteria
|
|
You will be given the standard output (`stdout`) from the ensemble test and, if applicable, the workflow test.
|
|
|
|
Please respond with your feedback in the following JSON format and order
|
|
```json
|
|
{
|
|
"execution": "Describe how well the ensemble executed, including any errors or issues encountered. Retain all error messages and traceback details.",
|
|
"return_checking": "Detail the checks performed on the ensemble results, including shape and value validation.",
|
|
"code": "Assess code quality, readability, and adherence to specifications. Consider efficiency, including whether the code utilizes multi-threading or GPU acceleration for optimization.",
|
|
"final_decision": <true/false>
|
|
}
|
|
```
|
|
user: |-
|
|
--------- Ensemble test stdout ---------
|
|
{{ stdout }}
|
|
{% if workflow_stdout is not none %}
|
|
--------- Whole workflow test stdout ---------
|
|
{{ workflow_stdout }}
|
|
{% endif %}
|