Skip to content

Commit cf4b277

Browse files
refactor: rename use_osworld_obs_preprocessor to skip_preprocessing for clarity
1 parent 7387922 commit cf4b277

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/agentlab/agents/tool_use_agent/tool_use_agent.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class Obs(Block):
166166
use_tabs: bool = False
167167
add_mouse_pointer: bool = False
168168
use_zoomed_webpage: bool = False
169-
use_osworld_obs_preprocessor: bool = False
169+
skip_preprocessing: bool = False
170170

171171
def apply(
172172
self, llm, discussion: StructuredDiscussion, obs: dict, last_llm_output: LLMOutput
@@ -382,7 +382,7 @@ def set_benchmark(self, benchmark: AgentLabBenchmark | BgymBenchmark, demo_mode:
382382
"""Set benchmark specific flags."""
383383
benchmark_name = benchmark.name
384384
if benchmark_name == "osworld":
385-
self.config.obs.use_osworld_obs_preprocessor = True
385+
self.config.obs.skip_preprocessing = True
386386

387387

388388
class ToolUseAgent(bgym.Agent):
@@ -414,8 +414,8 @@ def __init__(
414414

415415
def obs_preprocessor(self, obs):
416416
obs = copy(obs)
417-
if self.config.obs.use_osworld_obs_preprocessor:
418-
return self.osworld_obs_preprocessor(obs)
417+
if self.config.obs.skip_preprocessing:
418+
return obs
419419
page = obs.pop("page", None)
420420
if page is not None:
421421
obs["screenshot"] = extract_screenshot(page)
@@ -442,10 +442,6 @@ def obs_preprocessor(self, obs):
442442

443443
return obs
444444

445-
def osworld_obs_preprocessor(self, obs):
446-
"""Preprocess the observation for OSWorld benchmark."""
447-
return obs
448-
449445
def set_task_name(self, task_name: str):
450446
"""Cheater function that is supposed to be called by loop.py before callling get_action"""
451447
self.task_name = task_name

0 commit comments

Comments
 (0)