From 62135d846f10940c152d9dd3a0c757bf49fbf55b Mon Sep 17 00:00:00 2001 From: Steven Palma Date: Sun, 12 Apr 2026 16:43:24 +0200 Subject: [PATCH] license + peft-dep + init groot + flat import layering utils dataset --- pyproject.toml | 4 +-- src/lerobot/async_inference/__init__.py | 14 ++++++++++ src/lerobot/common/__init__.py | 14 ++++++++++ src/lerobot/datasets/dataset_metadata.py | 2 +- src/lerobot/datasets/io_utils.py | 4 +-- src/lerobot/model/__init__.py | 14 ++++++++++ src/lerobot/policies/act/__init__.py | 14 ++++++++++ src/lerobot/policies/diffusion/__init__.py | 14 ++++++++++ .../policies/groot/action_head/__init__.py | 2 ++ src/lerobot/policies/sac/__init__.py | 14 ++++++++++ .../policies/sac/reward_model/__init__.py | 14 ++++++++++ src/lerobot/policies/sarm/__init__.py | 14 ++++++++++ src/lerobot/policies/smolvla/__init__.py | 14 ++++++++++ src/lerobot/policies/tdmpc/__init__.py | 14 ++++++++++ src/lerobot/policies/vqbet/__init__.py | 14 ++++++++++ src/lerobot/rl/__init__.py | 14 ++++++++++ src/lerobot/transport/__init__.py | 14 ++++++++++ tests/utils.py | 27 ------------------- uv.lock | 4 +-- 19 files changed, 190 insertions(+), 35 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b6153f247..2f12840e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -169,7 +169,7 @@ phone = ["hebi-py>=2.8.0,<2.12.0", "teleop>=0.1.0,<0.2.0", "fastapi<1.0", "lerob diffusion = ["lerobot[diffusers-dep]"] wallx = [ "lerobot[transformers-dep]", - "lerobot[peft]", + "lerobot[peft-dep]", "lerobot[scipy-dep]", "torchdiffeq>=0.2.4,<0.3.0", "lerobot[qwen-vl-utils-dep]", @@ -179,7 +179,7 @@ smolvla = ["lerobot[transformers-dep]", "num2words>=0.5.14,<0.6.0", "accelerate> multi_task_dit = ["lerobot[transformers-dep]", "lerobot[diffusers-dep]"] groot = [ "lerobot[transformers-dep]", - "lerobot[peft]", + "lerobot[peft-dep]", "lerobot[diffusers-dep]", "dm-tree>=0.1.8,<1.0.0", "timm>=1.0.0,<1.1.0", diff --git a/src/lerobot/async_inference/__init__.py b/src/lerobot/async_inference/__init__.py index f1edccb87..8d7a22584 100644 --- a/src/lerobot/async_inference/__init__.py +++ b/src/lerobot/async_inference/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2024 The HuggingFace Inc. team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ Async inference server/client. diff --git a/src/lerobot/common/__init__.py b/src/lerobot/common/__init__.py index dfd97496d..782ef5b77 100644 --- a/src/lerobot/common/__init__.py +++ b/src/lerobot/common/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2024 The HuggingFace Inc. team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ Cross-cutting modules that bridge multiple lerobot packages. diff --git a/src/lerobot/datasets/dataset_metadata.py b/src/lerobot/datasets/dataset_metadata.py index 4b2d42838..8bf67fa39 100644 --- a/src/lerobot/datasets/dataset_metadata.py +++ b/src/lerobot/datasets/dataset_metadata.py @@ -25,6 +25,7 @@ from huggingface_hub import snapshot_download from lerobot.utils.constants import DEFAULT_FEATURES, HF_LEROBOT_HOME, HF_LEROBOT_HUB_CACHE from lerobot.utils.feature_utils import _validate_feature_names +from lerobot.utils.utils import flatten_dict from .compute_stats import aggregate_stats from .feature_utils import create_empty_dataset_info @@ -44,7 +45,6 @@ from .utils import ( DEFAULT_EPISODES_PATH, INFO_PATH, check_version_compatibility, - flatten_dict, get_safe_version, has_legacy_hub_download_metadata, is_valid_version, diff --git a/src/lerobot/datasets/io_utils.py b/src/lerobot/datasets/io_utils.py index c8da4fb94..2ee859e97 100644 --- a/src/lerobot/datasets/io_utils.py +++ b/src/lerobot/datasets/io_utils.py @@ -29,7 +29,7 @@ from PIL import Image as PILImage from torchvision import transforms from lerobot.utils.io_utils import load_json, write_json -from lerobot.utils.utils import SuppressProgressBars +from lerobot.utils.utils import SuppressProgressBars, flatten_dict, unflatten_dict from .utils import ( DEFAULT_DATA_FILE_SIZE_IN_MB, @@ -39,9 +39,7 @@ from .utils import ( EPISODES_DIR, INFO_PATH, STATS_PATH, - flatten_dict, serialize_dict, - unflatten_dict, ) diff --git a/src/lerobot/model/__init__.py b/src/lerobot/model/__init__.py index 53e1ed852..2f82e5053 100644 --- a/src/lerobot/model/__init__.py +++ b/src/lerobot/model/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2024 The HuggingFace Inc. team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Kinematics utilities for robot modeling. from .kinematics import RobotKinematics as RobotKinematics diff --git a/src/lerobot/policies/act/__init__.py b/src/lerobot/policies/act/__init__.py index ceafd63a8..44f15189f 100644 --- a/src/lerobot/policies/act/__init__.py +++ b/src/lerobot/policies/act/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2024 The HuggingFace Inc. team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from .configuration_act import ACTConfig from .modeling_act import ACTPolicy from .processor_act import make_act_pre_post_processors diff --git a/src/lerobot/policies/diffusion/__init__.py b/src/lerobot/policies/diffusion/__init__.py index b9a1a4d34..4f6ee820a 100644 --- a/src/lerobot/policies/diffusion/__init__.py +++ b/src/lerobot/policies/diffusion/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2024 The HuggingFace Inc. team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from .configuration_diffusion import DiffusionConfig from .modeling_diffusion import DiffusionPolicy from .processor_diffusion import make_diffusion_pre_post_processors diff --git a/src/lerobot/policies/groot/action_head/__init__.py b/src/lerobot/policies/groot/action_head/__init__.py index 3159bfe65..63ffc39e6 100644 --- a/src/lerobot/policies/groot/action_head/__init__.py +++ b/src/lerobot/policies/groot/action_head/__init__.py @@ -12,3 +12,5 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + +__all__: list[str] = [] diff --git a/src/lerobot/policies/sac/__init__.py b/src/lerobot/policies/sac/__init__.py index 7a0236708..cf5f149f3 100644 --- a/src/lerobot/policies/sac/__init__.py +++ b/src/lerobot/policies/sac/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2024 The HuggingFace Inc. team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from .configuration_sac import SACConfig from .modeling_sac import SACPolicy from .processor_sac import make_sac_pre_post_processors diff --git a/src/lerobot/policies/sac/reward_model/__init__.py b/src/lerobot/policies/sac/reward_model/__init__.py index d6c4d48ee..1504a9947 100644 --- a/src/lerobot/policies/sac/reward_model/__init__.py +++ b/src/lerobot/policies/sac/reward_model/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2024 The HuggingFace Inc. team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from .configuration_classifier import RewardClassifierConfig from .modeling_classifier import Classifier from .processor_classifier import make_classifier_processor diff --git a/src/lerobot/policies/sarm/__init__.py b/src/lerobot/policies/sarm/__init__.py index 85b24c59e..b164c87ef 100644 --- a/src/lerobot/policies/sarm/__init__.py +++ b/src/lerobot/policies/sarm/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2024 The HuggingFace Inc. team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from .configuration_sarm import SARMConfig from .modeling_sarm import SARMRewardModel diff --git a/src/lerobot/policies/smolvla/__init__.py b/src/lerobot/policies/smolvla/__init__.py index 516faaaf9..690f15860 100644 --- a/src/lerobot/policies/smolvla/__init__.py +++ b/src/lerobot/policies/smolvla/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2024 The HuggingFace Inc. team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from .configuration_smolvla import SmolVLAConfig from .modeling_smolvla import SmolVLAPolicy from .processor_smolvla import make_smolvla_pre_post_processors diff --git a/src/lerobot/policies/tdmpc/__init__.py b/src/lerobot/policies/tdmpc/__init__.py index 7a934f34a..5663e23c4 100644 --- a/src/lerobot/policies/tdmpc/__init__.py +++ b/src/lerobot/policies/tdmpc/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2024 The HuggingFace Inc. team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from .configuration_tdmpc import TDMPCConfig from .modeling_tdmpc import TDMPCPolicy from .processor_tdmpc import make_tdmpc_pre_post_processors diff --git a/src/lerobot/policies/vqbet/__init__.py b/src/lerobot/policies/vqbet/__init__.py index c1700df38..842dd5d0b 100644 --- a/src/lerobot/policies/vqbet/__init__.py +++ b/src/lerobot/policies/vqbet/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2024 The HuggingFace Inc. team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from .configuration_vqbet import VQBeTConfig from .modeling_vqbet import VQBeTPolicy from .processor_vqbet import make_vqbet_pre_post_processors diff --git a/src/lerobot/rl/__init__.py b/src/lerobot/rl/__init__.py index f6c5df0db..6a7c750d3 100644 --- a/src/lerobot/rl/__init__.py +++ b/src/lerobot/rl/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2024 The HuggingFace Inc. team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ Reinforcement learning modules. diff --git a/src/lerobot/transport/__init__.py b/src/lerobot/transport/__init__.py index 71f125e7e..92ed74188 100644 --- a/src/lerobot/transport/__init__.py +++ b/src/lerobot/transport/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2024 The HuggingFace Inc. team. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + """ gRPC transport layer for async inference. diff --git a/tests/utils.py b/tests/utils.py index b11ddb665..f8f4b135b 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -25,33 +25,6 @@ from lerobot.utils.import_utils import is_package_available DEVICE = os.environ.get("LEROBOT_TEST_DEVICE", str(auto_select_torch_device())) -AVAILABLE_ROBOTS = [ - "koch", - "koch_bimanual", - "aloha", - "so100", - "so101", -] -AVAILABLE_CAMERAS = [ - "opencv", - "intelrealsense", -] -AVAILABLE_MOTORS = [ - "dynamixel", - "feetech", -] - -TEST_ROBOT_TYPES = [] -for robot_type in AVAILABLE_ROBOTS: - TEST_ROBOT_TYPES += [(robot_type, True), (robot_type, False)] - -TEST_CAMERA_TYPES = [] -for camera_type in AVAILABLE_CAMERAS: - TEST_CAMERA_TYPES += [(camera_type, True), (camera_type, False)] - -TEST_MOTOR_TYPES = [] -for motor_type in AVAILABLE_MOTORS: - TEST_MOTOR_TYPES += [(motor_type, True), (motor_type, False)] # Camera indices used for connecting physical cameras OPENCV_CAMERA_INDEX = int(os.environ.get("LEROBOT_TEST_OPENCV_CAMERA_INDEX", 0)) diff --git a/uv.lock b/uv.lock index affeb5265..cbea9733e 100644 --- a/uv.lock +++ b/uv.lock @@ -2615,9 +2615,9 @@ requires-dist = [ { name = "lerobot", extras = ["multi-task-dit"], marker = "extra == 'all'" }, { name = "lerobot", extras = ["openarms"], marker = "extra == 'all'" }, { name = "lerobot", extras = ["peft"], marker = "extra == 'all'" }, - { name = "lerobot", extras = ["peft"], marker = "extra == 'groot'" }, - { name = "lerobot", extras = ["peft"], marker = "extra == 'wallx'" }, + { name = "lerobot", extras = ["peft-dep"], marker = "extra == 'groot'" }, { name = "lerobot", extras = ["peft-dep"], marker = "extra == 'peft'" }, + { name = "lerobot", extras = ["peft-dep"], marker = "extra == 'wallx'" }, { name = "lerobot", extras = ["phone"], marker = "extra == 'all'" }, { name = "lerobot", extras = ["pi"], marker = "extra == 'all'" }, { name = "lerobot", extras = ["placo-dep"], marker = "extra == 'hilserl'" },