Skip to content

Commit a8b29cc

Browse files
committed
script to test that osworld works in the ubuntu with docker
1 parent 30742cf commit a8b29cc

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

osworld_docker_test.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import logging
2+
from desktop_env.desktop_env import DesktopEnv
3+
4+
logging.basicConfig(
5+
level=logging.INFO,
6+
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
7+
handlers=[logging.StreamHandler()],
8+
)
9+
10+
example = {
11+
"id": "94d95f96-9699-4208-98ba-3c3119edf9c2",
12+
"instruction": "I want to install Spotify on my current system. Could you please help me?",
13+
"config": [
14+
{
15+
"type": "execute",
16+
"parameters": {
17+
"command": [
18+
"python",
19+
"-c",
20+
"import pyautogui; import time; pyautogui.click(960, 540); time.sleep(0.5);"
21+
]
22+
}
23+
}
24+
],
25+
"evaluator": {
26+
"func": "check_include_exclude",
27+
"result": {
28+
"type": "vm_command_line",
29+
"command": "which spotify"
30+
},
31+
"expected": {
32+
"type": "rule",
33+
"rules": {
34+
"include": ["spotify"],
35+
"exclude": ["not found"]
36+
}
37+
}
38+
}
39+
}
40+
41+
env = DesktopEnv(action_space="pyautogui", provider_name="docker", os_type="Ubuntu")
42+
43+
obs = env.reset(task_config=example)
44+
obs, reward, done, info = env.step("pyautogui.rightClick()")
45+
print(obs)

0 commit comments

Comments
 (0)