mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-30 18:31:25 +00:00
style
This commit is contained in:
@@ -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=[])
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user