-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun_baselines.py
More file actions
59 lines (46 loc) · 2.72 KB
/
run_baselines.py
File metadata and controls
59 lines (46 loc) · 2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from pathlib import Path
from unidomain.baselines import (
run_code_as_policies_batch,
run_isr_llm_batch,
run_ivml_batch,
run_react,
run_vlm_cot_batch,
run_vlm_cot_pddl_batch,
)
root_dir = Path(__file__).parent.parent.resolve()
task_data_path = root_dir / "data" / "tasks" / "task_data.json"
baseline_dir = root_dir / "outputs" / "baselines"
# =========================================================================
# ⚠️ SAFETY LOCK: Configuration Required
# =========================================================================
# By default, all runs are commented out to prevent accidental massive costs.
# Please uncomment the specific method you want to evaluate below.
# =========================================================================
# # Run VLM-CoT Baseline in Batch Mode
# run_vlm_cot_batch(task_data_path, baseline_dir / "vlm_cot_batch", num_workers=10)
# # Run VLM-CoT-PDDL Baseline in Batch Mode
# run_vlm_cot_pddl_batch(task_data_path, baseline_dir / "vlm_cot_pddl_batch", num_workers=10)
# # Run IVML Baseline in Batch Mode
# run_ivml_batch(task_data_path, baseline_dir / "ivml_batch", num_workers=10)
# # Run Code as Policies Baseline in Batch Mode
# run_code_as_policies_batch(task_data_path, baseline_dir / "code_as_policies_batch", num_workers=10)
# # Run ISR-LLM Baseline in Batch Mode
# run_isr_llm_batch(task_data_path, baseline_dir / "isr_llm_batch", num_workers=10)
# # If you want to run baselines above for a single task, please import the single mode function
# # Example:
# # from unidomain.baselines import run_vlm_cot
# # image_path, instruction, save_dir = ..., ..., ...
# # run_vlm_cot(image_path, instruction, save_dir)
# # Run ReAct Baseline. ReAct requires iteration, not supporting batch mode.
# # num_trials = 1 for ReAct
# # num_trials > 1 for Reflexion
# # max_steps specifies the max running step of Reflexion
# # video_index specifies the video device index on Ubuntu
# # Running ReAct requires other dependencies (opencv-python, etc.), using "pip install -e .[baselines] to install"
# # Note: ReAct is not supported on our DockerFile, please run locally (or setup X11 server yourself).
# image_path = root_dir / "data" / "tasks" / "BlockWorld" / "task_1.jpg"
# instruction = "Arrange all blocks in a single stack (from top to bottom): 1, 2, 3, 4, 5, 6, 7, 8."
# run_react(image_path, instruction, baseline_dir / "react", num_trials=1, max_steps=40, video_index=0)
# --- Safety Prompt ---
print("\n[Info] No baseline selected.")
print("Please open 'scripts/run_baselines.py' and uncomment the method you want to run.")