diff --git a/rdagent/app/data_science/conf.py b/rdagent/app/data_science/conf.py index a40c8e16..b1560533 100644 --- a/rdagent/app/data_science/conf.py +++ b/rdagent/app/data_science/conf.py @@ -140,6 +140,7 @@ class DataScienceBasePropSetting(KaggleBasePropSetting): model_architecture_suggestion_time_percent: float = 0.75 allow_longer_timeout: bool = False + longer_timeout_by_llm: bool = False coder_longer_timeout_multiplier_upper: int = 3 runner_longer_timeout_multiplier_upper: int = 2 timeout_increase_stage: float = 0.3 diff --git a/rdagent/scenarios/data_science/scen/__init__.py b/rdagent/scenarios/data_science/scen/__init__.py index ce1bd58d..b91f3831 100644 --- a/rdagent/scenarios/data_science/scen/__init__.py +++ b/rdagent/scenarios/data_science/scen/__init__.py @@ -119,9 +119,17 @@ class DataScienceScen(Scenario): ) self.metric_name = response_json_analysis.get("Metric Name", "custom_metric") self.metric_direction_guess = response_json_analysis.get("Metric Direction", True) - self.longer_time_limit_required = response_json_analysis.get( - "Longer time limit required", False - ) # True or False, whether the competition scenario requires a longer time limit to the code. + self.longer_time_limit_required = ( + False + if not DS_RD_SETTING.allow_longer_timeout + else ( + response_json_analysis.get("Longer time limit required", False) + if DS_RD_SETTING.longer_timeout_by_llm + else True + ) + ) + + # True or False, whether the competition scenario requires a longer time limit to the code. def real_debug_timeout(self): return ( @@ -130,7 +138,7 @@ class DataScienceScen(Scenario): DS_RD_SETTING.coder_longer_timeout_multiplier_upper, self.timeout_increase_count * DS_RD_SETTING.timeout_increase_stage + 1, ) - if self.longer_time_limit_required and DS_RD_SETTING.allow_longer_timeout + if self.longer_time_limit_required else DS_RD_SETTING.debug_timeout ) @@ -144,7 +152,7 @@ class DataScienceScen(Scenario): DS_RD_SETTING.runner_longer_timeout_multiplier_upper, self.timeout_increase_count * DS_RD_SETTING.timeout_increase_stage + 1, ) - if self.longer_time_limit_required and DS_RD_SETTING.allow_longer_timeout + if self.longer_time_limit_required else DS_RD_SETTING.full_timeout )