From 15960f0b5e1881e9c627d76ab67e2fae6705c42e Mon Sep 17 00:00:00 2001 From: AdilZouitine Date: Tue, 9 Sep 2025 16:11:38 +0200 Subject: [PATCH] refactor(utils): enhance task handling in add_envs_task function - Improved the `add_envs_task` function to validate the output of `task_description` and `task` calls, ensuring they return lists of strings. - Removed the use of `else` statement for environments without language instructions, simplifying the logic and enhancing readability. - Streamlined the observation dictionary handling by ensuring consistent data types for task attributes. --- src/lerobot/envs/utils.py | 1 - src/lerobot/scripts/eval.py | 1 - 2 files changed, 2 deletions(-) diff --git a/src/lerobot/envs/utils.py b/src/lerobot/envs/utils.py index e588f312b..b4f65ee9c 100644 --- a/src/lerobot/envs/utils.py +++ b/src/lerobot/envs/utils.py @@ -151,7 +151,6 @@ def add_envs_task(env: gym.vector.VectorEnv, observation: dict[str, Any]) -> dic observation["task"] = task_result else: # For envs without language instructions, e.g. aloha transfer cube and etc. - print(f"{observation.keys()}") num_envs = observation[list(observation.keys())[0]].shape[0] observation["task"] = ["" for _ in range(num_envs)] return observation diff --git a/src/lerobot/scripts/eval.py b/src/lerobot/scripts/eval.py index 39b821d91..252b6f515 100644 --- a/src/lerobot/scripts/eval.py +++ b/src/lerobot/scripts/eval.py @@ -155,7 +155,6 @@ def rollout( while not np.all(done): # Numpy array to tensor and changing dictionary keys to LeRobot policy format. observation = preprocess_observation(observation) - observation = preprocessor(observation) if return_observations: all_observations.append(deepcopy(observation))