Expand evaluation instructions
Browse files
README.md
CHANGED
|
@@ -56,6 +56,240 @@ While this repository is private, authenticate with the Hugging Face CLI or set
|
|
| 56 |
`HF_TOKEN` in the environment. The same calls work without authentication if the
|
| 57 |
repository is later made public.
|
| 58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
## Configurations and splits
|
| 60 |
|
| 61 |
| Configuration | Split | Rows | Unit |
|
|
|
|
| 56 |
`HF_TOKEN` in the environment. The same calls work without authentication if the
|
| 57 |
repository is later made public.
|
| 58 |
|
| 59 |
+
## Run an evaluation
|
| 60 |
+
|
| 61 |
+
`load_dataset()` loads the task and demonstration tables for inspection and
|
| 62 |
+
analysis. Executing the benchmark requires the
|
| 63 |
+
[UI-Mate evaluation harness](https://github.com/Tencent/UI-Mate/tree/main/osworker_bench),
|
| 64 |
+
an Ubuntu Docker VM, the mock applications, and an OpenAI-compatible model
|
| 65 |
+
endpoint. The supported entry points are the two Bash launchers in the GitHub
|
| 66 |
+
repository; they prepare assets, validate the task/cache pairing, start or reuse
|
| 67 |
+
vLLM, run the environments, retry missing results, and print an aggregate score.
|
| 68 |
+
|
| 69 |
+
### 1. Requirements
|
| 70 |
+
|
| 71 |
+
- A Linux host with Docker support. The released VM provider supports Ubuntu.
|
| 72 |
+
- Python 3.9 or newer.
|
| 73 |
+
- Node.js 20, npm 10, and `tmux` for the 98 mock applications.
|
| 74 |
+
- Enough disk space for the 27.45 GB qcow2 VM, model weights, videos, and run
|
| 75 |
+
artifacts.
|
| 76 |
+
- For local inference, GPUs supported by vLLM. The default UI-Mate configs use
|
| 77 |
+
tensor parallel size 2; edit the YAML or provide an existing endpoint if your
|
| 78 |
+
deployment differs.
|
| 79 |
+
- A mock host whose ports `8100-8197` are reachable from every benchmark VM.
|
| 80 |
+
|
| 81 |
+
### 2. Clone and install the harness
|
| 82 |
+
|
| 83 |
+
```bash
|
| 84 |
+
git clone https://github.com/Tencent/UI-Mate.git
|
| 85 |
+
cd UI-Mate/osworker_bench
|
| 86 |
+
|
| 87 |
+
python3 -m venv .venv
|
| 88 |
+
source .venv/bin/activate
|
| 89 |
+
pip install -r requirements.txt
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
The package alternative is:
|
| 93 |
+
|
| 94 |
+
```bash
|
| 95 |
+
pip install -e ".[full]"
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
Log in to Hugging Face before downloading private datasets or gated models:
|
| 99 |
+
|
| 100 |
+
```bash
|
| 101 |
+
hf auth login
|
| 102 |
+
hf auth whoami
|
| 103 |
+
```
|
| 104 |
+
|
| 105 |
+
### 3. Deploy the mock applications
|
| 106 |
+
|
| 107 |
+
The mock stack is a separate service; the benchmark launcher does not start it.
|
| 108 |
+
Deploy it on a host accessible from the Ubuntu VMs:
|
| 109 |
+
|
| 110 |
+
```bash
|
| 111 |
+
cd CUA-Gym-Hub
|
| 112 |
+
BASE_PORT=8100 bash deploy-all.sh --no-attach
|
| 113 |
+
cd ..
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
+
The bundled deployment script sorts all `*_mock` directories deterministically
|
| 117 |
+
and maps them to ports `8100-8197`, matching `.MOCK_HOST`. Confirm that the
|
| 118 |
+
first and last ports are reachable from the evaluation host and from inside the
|
| 119 |
+
VM. `MOCK_APP_BASE_URL` must contain only the scheme and host, with no port or
|
| 120 |
+
path, for example `http://mock-host.example`.
|
| 121 |
+
|
| 122 |
+
### 4. Configure the run
|
| 123 |
+
|
| 124 |
+
You can copy the environment template and set the mock host:
|
| 125 |
+
|
| 126 |
+
```bash
|
| 127 |
+
cp .env.example .env
|
| 128 |
+
```
|
| 129 |
+
|
| 130 |
+
At minimum, configure:
|
| 131 |
+
|
| 132 |
+
```dotenv
|
| 133 |
+
MOCK_APP_BASE_URL=http://mock-host.example
|
| 134 |
+
```
|
| 135 |
+
|
| 136 |
+
Do not commit `.env` or access tokens. The main configurations are:
|
| 137 |
+
|
| 138 |
+
- `configs/osworker_benchmark/ui_mate.yaml`: 100 instruction-only tasks using
|
| 139 |
+
`tencent/UI-Mate-27B`, up to 200 steps per task.
|
| 140 |
+
- `configs/osworker_benchmark/ui_mate_democua.yaml`: 33 self-demo tasks using
|
| 141 |
+
`tencent/UI-Mate-democua-27B`, up to 500 steps per task.
|
| 142 |
+
|
| 143 |
+
### 5. Run a one-task smoke test
|
| 144 |
+
|
| 145 |
+
Before launching all 100 tasks, verify the VM, mock host, model endpoint, and
|
| 146 |
+
evaluator with a one-task manifest:
|
| 147 |
+
|
| 148 |
+
```bash
|
| 149 |
+
printf '{"ae":["ae_contract_signature_001"]}\n' > /tmp/osworker-smoke.json
|
| 150 |
+
|
| 151 |
+
MOCK_APP_BASE_URL=http://mock-host.example \
|
| 152 |
+
BENCHMARK_META=/tmp/osworker-smoke.json \
|
| 153 |
+
NUM_ENVS=1 \
|
| 154 |
+
MAX_STEPS=30 \
|
| 155 |
+
bash scripts/osworker_benchmark/start_osworker_benchmark_test.sh
|
| 156 |
+
```
|
| 157 |
+
|
| 158 |
+
This short run is an infrastructure check; its task score is not comparable to
|
| 159 |
+
the full evaluation because of the reduced step budget.
|
| 160 |
+
|
| 161 |
+
### 6. Run the full 100-task benchmark
|
| 162 |
+
|
| 163 |
+
```bash
|
| 164 |
+
MOCK_APP_BASE_URL=http://mock-host.example \
|
| 165 |
+
bash scripts/osworker_benchmark/start_osworker_benchmark_test.sh
|
| 166 |
+
```
|
| 167 |
+
|
| 168 |
+
On the first run, the launcher:
|
| 169 |
+
|
| 170 |
+
1. downloads `tencent/UI-Mate-27B` unless `MODEL_PATH` or an endpoint is given;
|
| 171 |
+
2. downloads the pinned Ubuntu qcow2 and benchmark cache when absent;
|
| 172 |
+
3. synchronizes mock endpoints using `.MOCK_HOST`;
|
| 173 |
+
4. validates all manifest, task JSON, and cache-directory IDs;
|
| 174 |
+
5. starts/reuses Docker and vLLM; and
|
| 175 |
+
6. evaluates all 100 tasks with 10 parallel environments by default.
|
| 176 |
+
|
| 177 |
+
Useful overrides:
|
| 178 |
+
|
| 179 |
+
```bash
|
| 180 |
+
MOCK_APP_BASE_URL=http://mock-host.example \
|
| 181 |
+
NUM_ENVS=4 \
|
| 182 |
+
MAX_STEPS=200 \
|
| 183 |
+
REPEAT_RUNS=3 \
|
| 184 |
+
MODEL_PATH=/path/to/model \
|
| 185 |
+
bash scripts/osworker_benchmark/start_osworker_benchmark_test.sh
|
| 186 |
+
```
|
| 187 |
+
|
| 188 |
+
To reuse an existing compatible vLLM server, pass `host:port`. The default
|
| 189 |
+
instruction-only config expects the served model name `UI_Mate`:
|
| 190 |
+
|
| 191 |
+
```bash
|
| 192 |
+
MOCK_APP_BASE_URL=http://mock-host.example \
|
| 193 |
+
VLLM_ENDPOINT=10.0.0.20:8081 \
|
| 194 |
+
bash scripts/osworker_benchmark/start_osworker_benchmark_test.sh
|
| 195 |
+
```
|
| 196 |
+
|
| 197 |
+
### 7. Run the 33-task DemoCUA evaluation
|
| 198 |
+
|
| 199 |
+
Run the instruction-only launcher once first so the shared
|
| 200 |
+
`docker_vm_data/Ubuntu_openpyxl.qcow2` is available, then point the DemoCUA
|
| 201 |
+
launcher to that VM:
|
| 202 |
+
|
| 203 |
+
```bash
|
| 204 |
+
MOCK_APP_BASE_URL=http://mock-host.example \
|
| 205 |
+
OSWORLD_VM_SOURCE_PATH="$PWD/docker_vm_data/Ubuntu_openpyxl.qcow2" \
|
| 206 |
+
bash scripts/osworker_benchmark/start_osworker_benchmark_democua_test.sh
|
| 207 |
+
```
|
| 208 |
+
|
| 209 |
+
To reuse an existing endpoint, its served model name must match `MODEL_NAME`:
|
| 210 |
+
|
| 211 |
+
```bash
|
| 212 |
+
MOCK_APP_BASE_URL=http://mock-host.example \
|
| 213 |
+
OSWORLD_VM_SOURCE_PATH="$PWD/docker_vm_data/Ubuntu_openpyxl.qcow2" \
|
| 214 |
+
VLLM_ENDPOINT=10.0.0.20:8081 \
|
| 215 |
+
MODEL_NAME=UI_Mate_DemoCUA \
|
| 216 |
+
bash scripts/osworker_benchmark/start_osworker_benchmark_democua_test.sh
|
| 217 |
+
```
|
| 218 |
+
|
| 219 |
+
The launcher verifies that all 33 target tasks have a corresponding
|
| 220 |
+
`trajectory_captioned.json`. A missing demo would otherwise silently turn that
|
| 221 |
+
case into an instruction-only run and make results incomparable.
|
| 222 |
+
|
| 223 |
+
### 8. Use this repository's mirrored task cache
|
| 224 |
+
|
| 225 |
+
The GitHub launcher can download its public pinned cache automatically. If you
|
| 226 |
+
specifically want the copy in this dataset repository, materialize only the 100
|
| 227 |
+
active task directories before running:
|
| 228 |
+
|
| 229 |
+
```python
|
| 230 |
+
from pathlib import Path
|
| 231 |
+
|
| 232 |
+
from datasets import load_dataset
|
| 233 |
+
from huggingface_hub import snapshot_download
|
| 234 |
+
|
| 235 |
+
task_ids = load_dataset("tencent/OSWorkerBench")["test"]["id"]
|
| 236 |
+
snapshot_download(
|
| 237 |
+
repo_id="tencent/OSWorkerBench",
|
| 238 |
+
repo_type="dataset",
|
| 239 |
+
local_dir="osworker_cache",
|
| 240 |
+
allow_patterns=[f"{task_id}/**" for task_id in task_ids],
|
| 241 |
+
)
|
| 242 |
+
|
| 243 |
+
# The mirrored cache content comes from this immutable source revision.
|
| 244 |
+
Path("osworker_cache/.HF_REVISION").write_text(
|
| 245 |
+
"b6753bc357a756301f3429a95b38362da6035030\n"
|
| 246 |
+
)
|
| 247 |
+
```
|
| 248 |
+
|
| 249 |
+
The launcher will reuse this existing `osworker_cache/`. The qcow2 is
|
| 250 |
+
intentionally not mirrored here; the launcher retrieves it from the pinned
|
| 251 |
+
source linked under [Runtime assets](#runtime-assets).
|
| 252 |
+
|
| 253 |
+
### 9. Results and scoring
|
| 254 |
+
|
| 255 |
+
Each launcher prints the final result directory. Under it, per-task artifacts
|
| 256 |
+
follow this structure:
|
| 257 |
+
|
| 258 |
+
```text
|
| 259 |
+
<result-dir>/pyautogui/screenshot/<model>/<domain>/<task-id>/
|
| 260 |
+
result.txt
|
| 261 |
+
... logs, trajectory artifacts, screenshots, and optional video
|
| 262 |
+
```
|
| 263 |
+
|
| 264 |
+
`result.txt` contains the scalar evaluator score for that task. At the end of a
|
| 265 |
+
run, the harness prints the number of completed tasks, aggregate score, and a
|
| 266 |
+
per-domain breakdown. Missing `result.txt` files are treated as incomplete runs
|
| 267 |
+
and are retried according to `RETRY_MISSING_RESULTS` and
|
| 268 |
+
`MAX_MISSING_RESULT_RETRIES`.
|
| 269 |
+
|
| 270 |
+
For comparable published numbers, keep the released task manifest, task budget,
|
| 271 |
+
environment, evaluator files, and model-serving settings fixed. Record the
|
| 272 |
+
model revision, dataset/cache revision, config YAML, GPU/vLLM settings, and
|
| 273 |
+
`REPEAT_RUNS` with the result.
|
| 274 |
+
|
| 275 |
+
### Troubleshooting
|
| 276 |
+
|
| 277 |
+
- **Mock connection failures:** verify `MOCK_APP_BASE_URL` has no port/path and
|
| 278 |
+
that ports `8100-8197` are reachable from inside the VM.
|
| 279 |
+
- **Model not found from an existing endpoint:** make the endpoint's
|
| 280 |
+
`--served-model-name` match the config's `MODEL_NAME`.
|
| 281 |
+
- **Cache revision mismatch:** remove and re-download `osworker_cache/`.
|
| 282 |
+
`ALLOW_UNVERIFIED_CACHE=1` should only be used for a manually verified cache.
|
| 283 |
+
- **Missing VM or low disk space:** the qcow2 alone is 27.45 GB; confirm the
|
| 284 |
+
download completed and leave additional space for model weights and videos.
|
| 285 |
+
- **Partial run:** inspect `.missing_result_tasks.txt` in the printed result
|
| 286 |
+
directory. The launcher retries missing cases within that run; if cases are
|
| 287 |
+
still missing after the configured retries, fix the infrastructure issue and
|
| 288 |
+
start a new run.
|
| 289 |
+
- **Proxy deployment:** configure `HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY`,
|
| 290 |
+
`OSWORLD_PROXY_HOST`, and `OSWORLD_PROXY_PORT` as documented in the
|
| 291 |
+
[full benchmark README](https://github.com/Tencent/UI-Mate/blob/main/osworker_bench/README.md).
|
| 292 |
+
|
| 293 |
## Configurations and splits
|
| 294 |
|
| 295 |
| Configuration | Split | Rows | Unit |
|