From dbe214282e84f099512eeaf01925c7dee1b780a6 Mon Sep 17 00:00:00 2001 From: you-n-g Date: Sun, 17 Aug 2025 16:08:55 +0800 Subject: [PATCH] fix: skip res_ratio check if timer or res_time is None (#1189) --- rdagent/scenarios/data_science/dev/runner/eval.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rdagent/scenarios/data_science/dev/runner/eval.py b/rdagent/scenarios/data_science/dev/runner/eval.py index 19252f9e..39e4c39f 100644 --- a/rdagent/scenarios/data_science/dev/runner/eval.py +++ b/rdagent/scenarios/data_science/dev/runner/eval.py @@ -180,8 +180,11 @@ class DSRunnerEvaluator(CoSTEEREvaluator): c3 = True # 4. The current time spent on global is less than the time limit ratio for whole timeout. - res_ratio = res_time / timer.all_duration - c4 = res_ratio <= DS_RD_SETTING.res_time_ratio_limit_to_enable_hyperparameter_tuning + if timer.all_duration is not None and res_time is not None: + res_ratio = res_time / timer.all_duration + c4 = res_ratio <= DS_RD_SETTING.res_time_ratio_limit_to_enable_hyperparameter_tuning + else: + c4 = True # Only enable hyperparameter tuning check if all conditions are met enable_hyperparameter_tuning_check = c1 and c2 and c3 and c4