From ea8127996460005c7349d13c1b69e0c21e923b16 Mon Sep 17 00:00:00 2001 From: lesjie-wen <870351470@qq.com> Date: Mon, 31 Mar 2025 21:41:34 +0800 Subject: [PATCH] add license --- .../policies/dexvla/configuration_dexvla.py | 5 ++++- .../common/policies/dexvla/fusion_modules.py | 17 ++++++++++++++++- .../common/policies/dexvla/modeling_dexvla.py | 16 ++++++++++++++++ .../policies/dexvla/policy_heads/__init__.py | 16 ++++++++++++++++ .../policy_heads/configuration_scaledp.py | 17 +++++++++++++++++ .../configuration_unet_diffusion.py | 16 ++++++++++++++++ .../dexvla/policy_heads/modeling_scaledp.py | 18 ++++++++++++++++-- .../policy_heads/modeling_unet_diffusion.py | 18 +++++++++++++++--- .../policies/dexvla/qwe2_vla/__init__.py | 16 ++++++++++++++++ .../dexvla/qwe2_vla/configuration_qwen2_vla.py | 5 +++-- .../dexvla/qwe2_vla/modeling_qwen2_vla.py | 9 +++------ .../policies/dexvla/robot_data_processor.py | 17 ++++++++++++++++- 12 files changed, 154 insertions(+), 16 deletions(-) diff --git a/lerobot/common/policies/dexvla/configuration_dexvla.py b/lerobot/common/policies/dexvla/configuration_dexvla.py index 76304057..a4743361 100644 --- a/lerobot/common/policies/dexvla/configuration_dexvla.py +++ b/lerobot/common/policies/dexvla/configuration_dexvla.py @@ -1,4 +1,6 @@ -# Copyright 2024 The Qwen team, Alibaba Group and the HuggingFace Inc. team. All rights reserved. +#!/usr/bin/env python + +# Copyright 2025 DexVLA Team and 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. @@ -11,6 +13,7 @@ # 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. + """Qwen2VL model configuration""" from dataclasses import dataclass, field diff --git a/lerobot/common/policies/dexvla/fusion_modules.py b/lerobot/common/policies/dexvla/fusion_modules.py index 0d977edc..bff61072 100644 --- a/lerobot/common/policies/dexvla/fusion_modules.py +++ b/lerobot/common/policies/dexvla/fusion_modules.py @@ -1,5 +1,20 @@ -import torch.nn as nn +#!/usr/bin/env python +# Copyright 2025 DexVLA Team and 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. + +import torch.nn as nn class ActionProjector(nn.Module): def __init__(self, in_dim, out_dim=1024): diff --git a/lerobot/common/policies/dexvla/modeling_dexvla.py b/lerobot/common/policies/dexvla/modeling_dexvla.py index b90535fa..c932bdd7 100644 --- a/lerobot/common/policies/dexvla/modeling_dexvla.py +++ b/lerobot/common/policies/dexvla/modeling_dexvla.py @@ -1,3 +1,19 @@ +#!/usr/bin/env python + +# Copyright 2025 DexVLA Team and 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 collections import deque import torch diff --git a/lerobot/common/policies/dexvla/policy_heads/__init__.py b/lerobot/common/policies/dexvla/policy_heads/__init__.py index bf25637c..f3b6a169 100644 --- a/lerobot/common/policies/dexvla/policy_heads/__init__.py +++ b/lerobot/common/policies/dexvla/policy_heads/__init__.py @@ -1,3 +1,19 @@ +#!/usr/bin/env python + +# Copyright 2025 DexVLA Team and 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 transformers import AutoConfig, AutoModel from .configuration_scaledp import ScaleDPPolicyConfig diff --git a/lerobot/common/policies/dexvla/policy_heads/configuration_scaledp.py b/lerobot/common/policies/dexvla/policy_heads/configuration_scaledp.py index d84caf48..e2d71cea 100644 --- a/lerobot/common/policies/dexvla/policy_heads/configuration_scaledp.py +++ b/lerobot/common/policies/dexvla/policy_heads/configuration_scaledp.py @@ -1,3 +1,20 @@ +#!/usr/bin/env python + +# Copyright 2025 DexVLA Team and 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. + + import os from typing import Union diff --git a/lerobot/common/policies/dexvla/policy_heads/configuration_unet_diffusion.py b/lerobot/common/policies/dexvla/policy_heads/configuration_unet_diffusion.py index 3f40cbef..b7eb046e 100644 --- a/lerobot/common/policies/dexvla/policy_heads/configuration_unet_diffusion.py +++ b/lerobot/common/policies/dexvla/policy_heads/configuration_unet_diffusion.py @@ -1,3 +1,19 @@ +#!/usr/bin/env python + +# Copyright 2025 DexVLA Team and 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. + import os from typing import Union diff --git a/lerobot/common/policies/dexvla/policy_heads/modeling_scaledp.py b/lerobot/common/policies/dexvla/policy_heads/modeling_scaledp.py index 8a96eefe..62ff0587 100644 --- a/lerobot/common/policies/dexvla/policy_heads/modeling_scaledp.py +++ b/lerobot/common/policies/dexvla/policy_heads/modeling_scaledp.py @@ -1,5 +1,19 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. +#!/usr/bin/env python + +# Copyright 2025 DexVLA Team and 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. + import logging import math from typing import Tuple diff --git a/lerobot/common/policies/dexvla/policy_heads/modeling_unet_diffusion.py b/lerobot/common/policies/dexvla/policy_heads/modeling_unet_diffusion.py index 0631d9b3..0dea2e90 100644 --- a/lerobot/common/policies/dexvla/policy_heads/modeling_unet_diffusion.py +++ b/lerobot/common/policies/dexvla/policy_heads/modeling_unet_diffusion.py @@ -1,6 +1,18 @@ -""" -Implementation of Diffusion Policy https://diffusion-policy.cs.columbia.edu/ by Cheng Chi -""" +#!/usr/bin/env python + +# Copyright 2025 DexVLA Team and 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. import copy import math diff --git a/lerobot/common/policies/dexvla/qwe2_vla/__init__.py b/lerobot/common/policies/dexvla/qwe2_vla/__init__.py index 38a5cbca..35627635 100644 --- a/lerobot/common/policies/dexvla/qwe2_vla/__init__.py +++ b/lerobot/common/policies/dexvla/qwe2_vla/__init__.py @@ -1,3 +1,19 @@ +#!/usr/bin/env python + +# Copyright 2025 DexVLA Team and 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 transformers import AutoConfig, AutoModelForCausalLM from .configuration_qwen2_vla import Qwen2VLAConfig diff --git a/lerobot/common/policies/dexvla/qwe2_vla/configuration_qwen2_vla.py b/lerobot/common/policies/dexvla/qwe2_vla/configuration_qwen2_vla.py index 628bca77..1a3e7411 100644 --- a/lerobot/common/policies/dexvla/qwe2_vla/configuration_qwen2_vla.py +++ b/lerobot/common/policies/dexvla/qwe2_vla/configuration_qwen2_vla.py @@ -1,4 +1,6 @@ -# Copyright 2024 The Qwen team, Alibaba Group and the HuggingFace Inc. team. All rights reserved. +#!/usr/bin/env python + +# Copyright 2025 DexVLA Team and 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. @@ -11,7 +13,6 @@ # 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. -"""Qwen2VL model configuration""" import os from typing import Union diff --git a/lerobot/common/policies/dexvla/qwe2_vla/modeling_qwen2_vla.py b/lerobot/common/policies/dexvla/qwe2_vla/modeling_qwen2_vla.py index 2fccd565..4b656354 100644 --- a/lerobot/common/policies/dexvla/qwe2_vla/modeling_qwen2_vla.py +++ b/lerobot/common/policies/dexvla/qwe2_vla/modeling_qwen2_vla.py @@ -1,9 +1,6 @@ -# Copyright 2024 The Qwen team, Alibaba Group and the HuggingFace Inc. team. All rights reserved. -# -# This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX -# and OPT implementations in this library. It has been modified from its -# original forms to accommodate minor architectural differences compared -# to GPT-NeoX and OPT used by the Meta AI team that trained the model. +#!/usr/bin/env python + +# Copyright 2025 DexVLA Team and 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. diff --git a/lerobot/common/policies/dexvla/robot_data_processor.py b/lerobot/common/policies/dexvla/robot_data_processor.py index d57035db..3a7ce995 100644 --- a/lerobot/common/policies/dexvla/robot_data_processor.py +++ b/lerobot/common/policies/dexvla/robot_data_processor.py @@ -1,9 +1,24 @@ +#!/usr/bin/env python + +# Copyright 2025 DexVLA Team and 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. + import numpy as np import torch from PIL import Image from qwen_vl_utils import fetch_image - class Qwen2VLAProcess: def __init__( self,