Merge branch 'main' of https://github.com/xlang-ai/OSWorld
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
<p align="center">
|
||||
<a href="https://os-world.github.io/">Website</a> •
|
||||
<a href="https://arxiv.org/abs/2404.07972">Paper</a> •
|
||||
<a href="https://timothyxxx.github.io/OSWorld/">Doc</a> •
|
||||
<a href="https://github.com/xlang-ai/OSWorld/tree/main/evaluation_examples">Data</a> •
|
||||
<a href="https://os-world.github.io/explorer.html">Data Viewer</a> •
|
||||
<a href="https://discord.gg/4Gnw7eTEZR">Discord</a>
|
||||
|
||||
@@ -580,11 +580,33 @@ class SetupController:
|
||||
return browser, context
|
||||
|
||||
def _update_browse_history_setup(self, **config):
|
||||
db_path = os.path.join("desktop_env", "assets", "history_empty.sqlite")
|
||||
|
||||
# copy a new history file in the tmp folder
|
||||
cache_path = os.path.join(self.cache_dir, "history_new.sqlite")
|
||||
shutil.copyfile(db_path, cache_path)
|
||||
db_url = "https://drive.usercontent.google.com/u/0/uc?id=1Lv74QkJYDWVX0RIgg0Co-DUcoYpVL0oX&export=download" # google drive
|
||||
if not os.path.exists(cache_path):
|
||||
max_retries = 3
|
||||
downloaded = False
|
||||
e = None
|
||||
for i in range(max_retries):
|
||||
try:
|
||||
response = requests.get(db_url, stream=True)
|
||||
response.raise_for_status()
|
||||
|
||||
with open(cache_path, 'wb') as f:
|
||||
for chunk in response.iter_content(chunk_size=8192):
|
||||
if chunk:
|
||||
f.write(chunk)
|
||||
logger.info("File downloaded successfully")
|
||||
downloaded = True
|
||||
break
|
||||
|
||||
except requests.RequestException as e:
|
||||
logger.error(
|
||||
f"Failed to download {db_url} caused by {e}. Retrying... ({max_retries - i - 1} attempts left)")
|
||||
if not downloaded:
|
||||
raise requests.RequestException(f"Failed to download {db_url}. No retries left. Error: {e}")
|
||||
else:
|
||||
logger.info("File already exists in cache directory")
|
||||
# copy a new history file in the tmp folder
|
||||
db_path = cache_path
|
||||
|
||||
history = config['history']
|
||||
@@ -632,9 +654,14 @@ class SetupController:
|
||||
"""import os; print(os.path.join(os.getenv('HOME'), "Library", "Application Support", "Google", "Chrome", "Default", "History"))""")[
|
||||
'output'].strip()
|
||||
elif os_type == 'Linux':
|
||||
chrome_history_path = controller.execute_python_command(
|
||||
"import os; print(os.path.join(os.getenv('HOME'), '.config', 'google-chrome', 'Default', 'History'))")[
|
||||
'output'].strip()
|
||||
if "arm" in platform.machine():
|
||||
chrome_history_path = controller.execute_python_command(
|
||||
"import os; print(os.path.join(os.getenv('HOME'), 'snap', 'chromium', 'common', 'chromium', 'Default', 'History'))")[
|
||||
'output'].strip()
|
||||
else:
|
||||
chrome_history_path = controller.execute_python_command(
|
||||
"import os; print(os.path.join(os.getenv('HOME'), '.config', 'google-chrome', 'Default', 'History'))")[
|
||||
'output'].strip()
|
||||
else:
|
||||
raise Exception('Unsupported operating system')
|
||||
|
||||
|
||||
@@ -15,7 +15,8 @@ You need to assign values to several variables crucial for the operation of thes
|
||||
- Formatted as follows:
|
||||
```python
|
||||
IMAGE_ID_MAP = {
|
||||
"us-east-1": "ami-09bab251951b4272c",
|
||||
"us-east-1": "ami-019f92c05df45031b",
|
||||
"ap-east-1": "ami-07b4956131da1b282"
|
||||
# Add other regions and corresponding AMIs
|
||||
}
|
||||
```
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
"func": "compare_pptx_files",
|
||||
"expected": {
|
||||
"type": "cloud_file",
|
||||
"path": "https://drive.usercontent.google.com/download?id=1W6yRtc3Z6lGBdwvGqoU4CC20TDKw1Pdq&export=download&authuser=0&confirm=t&uuid=a20dc92d-9d78-4c32-ad3b-a2fd068fd167&at=APZUnTWUSZoFc5RheJ8QOwadHnjF:1709110061143",
|
||||
"path": "https://drive.usercontent.google.com/download?id=1W6yRtc3Z6lGBdwvGqoU4CC20TDKw1Pdq&export=download&authuser=0&confirm=t&uuid=157e59b1-5b50-48a5-a9bc-aaa1e5d3c5bb&at=APZUnTXLw32ithWfa1jMREjb6Aaa:1720111552480",
|
||||
"dest": "13_0_Gold.pptx"
|
||||
},
|
||||
"result": {
|
||||
@@ -73,4 +73,4 @@
|
||||
"examine_shape": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user