Compatible with agents that cannot use runtime log

This commit is contained in:
yuanmengqi
2025-07-20 07:55:53 +00:00
parent c6c62c52d7
commit 88d5639a2a

View File

@@ -10,8 +10,13 @@ logger = logging.getLogger("desktopenv.experiment")
def run_single_example(agent, env, example, max_steps, instruction, args, example_result_dir, scores):
runtime_logger = setup_logger(example, example_result_dir)
agent.reset(runtime_logger)
try:
agent.reset(runtime_logger)
except Exception as e:
agent.reset()
env.reset(task_config=example)
time.sleep(60) # Wait for the environment to be ready
obs = env._get_obs() # Get the initial observation
done = False