new timer, but need to set in setting.json file, need to be upgraded into parameters

This commit is contained in:
Jason Lee
2024-03-16 12:36:23 +08:00
parent 44679724b8
commit 053da203b8
12 changed files with 13 additions and 47 deletions

View File

@@ -1,11 +1,17 @@
import os
import datetime
import json
from wrapt_timeout_decorator import *
import logging
from wrapt_timeout_decorator import *
logger = logging.getLogger("desktopenv.experiment")
@timeout(60, use_signals=False)
# Open the JSON file
with open("./settings.json", "r") as file:
# Load the JSON data from the file
data = json.load(file)
time_limit = data["time_limit"]
@timeout(time_limit, use_signals=False)
def run_single_example(agent, env, example, max_steps, instruction, args, example_result_dir, scores):
agent.reset()
obs = env.reset(task_config=example)