This commit is contained in:
Jade Choghari
2025-11-18 17:29:25 +01:00
parent b257e02ccf
commit 4fb41d3e5a
2 changed files with 4 additions and 4 deletions

View File

@@ -56,7 +56,7 @@ def make_env_pre_post_processors(
# For LIBERO environments, add the LiberoProcessorStep
if isinstance(env_cfg, LiberoEnv) or "libero" in env_cfg.type:
return PolicyProcessorPipeline(steps=[LiberoProcessorStep()])
# For all other environments, return an identity processor (does nothing)
return PolicyProcessorPipeline(steps=[])

View File

@@ -166,7 +166,7 @@ def rollout(
# Infer "task" from attributes of environments.
# TODO: works with SyncVectorEnv but not AsyncVectorEnv
observation = add_envs_task(env, observation)
# Apply environment-specific preprocessing (e.g., LiberoProcessorStep for LIBERO)
observation = env_preprocessor(observation)
@@ -524,10 +524,10 @@ def eval_main(cfg: EvalPipelineConfig):
pretrained_path=cfg.policy.pretrained_path,
preprocessor_overrides=preprocessor_overrides,
)
# Create environment-specific preprocessor (e.g., for LIBERO environments)
env_preprocessor = make_env_pre_post_processors(env_cfg=cfg.env)
with torch.no_grad(), torch.autocast(device_type=device.type) if cfg.policy.use_amp else nullcontext():
info = eval_policy_all(
envs=envs,