new timer, but need to set in setting.json file, need to be upgraded into parameters
This commit is contained in:
4
.vscode/launch.json
vendored
4
.vscode/launch.json
vendored
@@ -11,8 +11,8 @@
|
|||||||
"program": "${file}",
|
"program": "${file}",
|
||||||
"console": "integratedTerminal",
|
"console": "integratedTerminal",
|
||||||
"args": [
|
"args": [
|
||||||
"--path_to_vm", "/Users/lxc/Virtual Machines.localized/DesktopEnv-Ubuntu 64-bit Arm.vmwarevm/DesktopEnv-Ubuntu 64-bit Arm.vmx",
|
"--path_to_vm", "/Users/lxc/Virtual Machines.localized/DesktopEnv-Ubuntu 64-bit Arm.vmwarevm/DesktopEnv-Ubuntu 64-bit Arm.vmx"
|
||||||
"--example_time_limit", "60"
|
// "--example_time_limit", "60"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
# conf_my_program.py:
|
|
||||||
|
|
||||||
class ConfMyProgram(object):
|
|
||||||
def __init__(self):
|
|
||||||
self.name:str = 'my_var_name'
|
|
||||||
|
|
||||||
conf_my_program = ConfMyProgram()
|
|
||||||
16
demo.py
16
demo.py
@@ -1,16 +0,0 @@
|
|||||||
# my_program_main.py:
|
|
||||||
|
|
||||||
import lib_test
|
|
||||||
|
|
||||||
def main():
|
|
||||||
try:
|
|
||||||
while True:
|
|
||||||
print(1)
|
|
||||||
lib_test.mytest()
|
|
||||||
# try:
|
|
||||||
# lib_test.mytest()
|
|
||||||
except Exception as e:
|
|
||||||
print(e)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
||||||
@@ -1,11 +1,17 @@
|
|||||||
import os
|
import os
|
||||||
import datetime
|
import datetime
|
||||||
import json
|
import json
|
||||||
from wrapt_timeout_decorator import *
|
|
||||||
import logging
|
import logging
|
||||||
|
from wrapt_timeout_decorator import *
|
||||||
logger = logging.getLogger("desktopenv.experiment")
|
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):
|
def run_single_example(agent, env, example, max_steps, instruction, args, example_result_dir, scores):
|
||||||
agent.reset()
|
agent.reset()
|
||||||
obs = env.reset(task_config=example)
|
obs = env.reset(task_config=example)
|
||||||
|
|||||||
15
lib_test.py
15
lib_test.py
@@ -1,15 +0,0 @@
|
|||||||
# lib_test.py:
|
|
||||||
|
|
||||||
from wrapt_timeout_decorator import *
|
|
||||||
from time import sleep
|
|
||||||
from conf_my_program import conf_my_program
|
|
||||||
|
|
||||||
# use_signals = False is not really necessary here, it is set automatically under Windows
|
|
||||||
# but You can force NOT to use Signals under Linux
|
|
||||||
@timeout(5, use_signals=False)
|
|
||||||
def mytest():
|
|
||||||
print("Start ", conf_my_program.name)
|
|
||||||
for i in range(1,10):
|
|
||||||
sleep(1)
|
|
||||||
print("{} seconds have passed".format(i))
|
|
||||||
return i
|
|
||||||
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 437 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 437 KiB |
@@ -1,3 +0,0 @@
|
|||||||
{"step_num": 1, "action_timestamp": "20240316@115041", "action": "tag_1=(1212, 753)\ntag_2=(302, 81)\ntag_3=(541, 81)\ntag_4=(583, 81)\ntag_5=(1248, 81)\ntag_6=(156, 119)\ntag_7=(196, 119)\ntag_8=(642, 119)\ntag_9=(1090, 119)\ntag_10=(1122, 119)\ntag_11=(1162, 119)\ntag_12=(1194, 119)\ntag_13=(1226, 119)\ntag_14=(1262, 119)\ntag_15=(675, 486)\ntag_16=(147, 202)\ntag_17=(682, 201)\ntag_18=(672, 201)\ntag_19=(1078, 201)\ntag_20=(667, 638)\ntag_21=(667, 421)\ntag_22=(667, 420)\ntag_23=(667, 419)\ntag_24=(667, 798)\ntag_25=(667, 797)\npyautogui.click(tag_15)", "reward": 0, "done": false, "info": {}, "screenshot_file": "step_1_20240316@115041.png"}
|
|
||||||
{"step_num": 2, "action_timestamp": "20240316@115102", "action": "tag_1=(1212, 753)\ntag_2=(302, 81)\ntag_3=(541, 81)\ntag_4=(583, 81)\ntag_5=(1248, 81)\ntag_6=(156, 119)\ntag_7=(196, 119)\ntag_8=(642, 119)\ntag_9=(1090, 119)\ntag_10=(1122, 119)\ntag_11=(1162, 119)\ntag_12=(1194, 119)\ntag_13=(1226, 119)\ntag_14=(1262, 119)\ntag_15=(675, 486)\ntag_16=(667, 322)\ntag_17=(688, 294)\ntag_18=(686, 291)\ntag_19=(688, 335)\ntag_20=(686, 335)\ntag_21=(667, 558)\ntag_22=(667, 545)\ntag_23=(667, 518)\ntag_24=(667, 451)\ntag_25=(654, 449)\ntag_26=(667, 509)\ntag_27=(733, 554)\ntag_28=(742, 554)\ntag_29=(742, 554)\ntag_30=(667, 579)\ntag_31=(667, 661)\ntag_32=(667, 660)\ntag_33=(667, 802)\ntag_34=(617, 801)\ntag_35=(617, 801)\ntag_36=(727, 801)\ntag_37=(727, 801)\n# Estimating the position of the browser's menu button\nmenu_x = tag_16[0] + (tag_18[0] - tag_16[0]) - 50 # 50 pixels to the left from the right end of the address bar\nmenu_y = tag_16[1] + (tag_19[1] - tag_16[1]) / 2 # Vertically centered between the top of the address bar and the bottom\npyautogui.click(menu_x, menu_y)", "reward": 0, "done": false, "info": {}, "screenshot_file": "step_2_20240316@115102.png"}
|
|
||||||
{"Error": "Time limit exceeded in chrome/7b6c7e24-c58a-49fc-a5bb-d57b80e5b4c3"}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"Error": "Time limit exceeded in chrome/bb5e4c0d-f964-439c-97b6-bdb9747de3f4"}
|
|
||||||
1
run.py
1
run.py
@@ -10,7 +10,6 @@ import sys
|
|||||||
|
|
||||||
from tqdm import tqdm
|
from tqdm import tqdm
|
||||||
import time
|
import time
|
||||||
# import timeout_decorator
|
|
||||||
|
|
||||||
from desktop_env.envs.desktop_env import DesktopEnv
|
from desktop_env.envs.desktop_env import DesktopEnv
|
||||||
from mm_agents.agent import PromptAgent
|
from mm_agents.agent import PromptAgent
|
||||||
|
|||||||
3
settings.json
Normal file
3
settings.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"time_limit": "60"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user