From b3acf213331af23b84ce3203a8fa3d0c9d13f394 Mon Sep 17 00:00:00 2001 From: Timothyxxx <384084775@qq.com> Date: Tue, 23 Apr 2024 14:04:59 +0800 Subject: [PATCH] Fix https://github.com/xlang-ai/OSWorld/issues/27 --- desktop_env/envs/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/desktop_env/envs/__init__.py b/desktop_env/envs/__init__.py index 3f54d12..3dd509c 100644 --- a/desktop_env/envs/__init__.py +++ b/desktop_env/envs/__init__.py @@ -189,9 +189,12 @@ def _install_virtual_machine(vm_name, working_dir="./vm_data", downloaded_file_n os.makedirs(working_dir, exist_ok=True) def __download_and_unzip_vm(): # Determine the platform and CPU architecture to decide the correct VM image to download - if platform.machine() == 'arm64': # macOS with Apple Silicon - url = UBUNTU_ARM_URL - elif platform.machine().lower() in ['amd64', "x86_64"]: + if platform.system() == 'Darwin': # macOS + if os.uname().machine == 'arm64': # Apple Silicon + url = UBUNTU_ARM_URL + else: + url = UBUNTU_X86_URL + elif platform.machine().lower() in ['amd64', 'x86_64']: url = UBUNTU_X86_URL else: raise Exception("Unsupported platform or architecture")