From c46fcbfcbecdb8435002b0ec24cb9dcc1fd1850e Mon Sep 17 00:00:00 2001 From: David Chang Date: Fri, 2 Feb 2024 09:30:10 +0800 Subject: [PATCH] ver Feb2ndv3 working on human eval for multi_apps --- desktop_env/controllers/setup.py | 11 +++++++---- main.py | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/desktop_env/controllers/setup.py b/desktop_env/controllers/setup.py index a29021b..95e18d3 100644 --- a/desktop_env/controllers/setup.py +++ b/desktop_env/controllers/setup.py @@ -406,7 +406,7 @@ class SetupController: except Exception as e: if attempt < 14: logger.error(f"Attempt {attempt + 1}: Failed to connect, retrying. Error: {e}") - time.sleep(1) + time.sleep(5) else: logger.error(f"Failed to connect after multiple attempts: {e}") raise e @@ -531,20 +531,23 @@ class SetupController: except Exception as e: if attempt < 14: logger.error(f"Attempt {attempt + 1}: Failed to connect, retrying. Error: {e}") - time.sleep(1) + time.sleep(5) else: logger.error(f"Failed to connect after multiple attempts: {e}") raise e if not browser: return - + context = browser.contexts[0] platform = config['platform'] if platform == 'googledrive': url = 'https://drive.google.com/drive/my-drive' page = context.new_page() # Create a new page (tab) within the existing context - page.goto(url) + try: + page.goto(url, timeout=60000) + except: + logger.warning("Opening %s exceeds time limit", url) # only for human test logger.info(f"Opened new page: {url}") settings = json.load(open(config['settings_file'])) email, password = settings['email'], settings['password'] diff --git a/main.py b/main.py index 9f0b324..7b18f0b 100644 --- a/main.py +++ b/main.py @@ -47,9 +47,9 @@ def human_agent(): Runs the Gym environment with human input. """ - with open("evaluation_examples/examples/vlc/215dfd39-f493-4bc3-a027-8a97d72c61bf.json", "r") as f: + with open("evaluation_examples/examples/multi_apps/510f64c8-9bcc-4be1-8d30-638705850618.json", "r") as f: example = json.load(f) - example["snapshot"] = "Snapshot 36" + example["snapshot"] = "Snapshot 35" #env = DesktopEnv( path_to_vm="~/vmware/Windows 10 x64/Windows 10 x64.vmx" env = DesktopEnv( path_to_vm="/mnt/data1/david/os-images/Ubuntu-1218/Ubuntu.vmx"