mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-23 09:46:00 +00:00
update
This commit is contained in:
committed by
Michel Aractingi
parent
a754c86f64
commit
d2b16afb12
@@ -34,14 +34,10 @@ lerobot-train \
|
|||||||
```
|
```
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import builtins
|
|
||||||
import glob
|
|
||||||
import math
|
import math
|
||||||
import os
|
|
||||||
from os import PathLike
|
from os import PathLike
|
||||||
import sys
|
|
||||||
from collections import deque
|
from collections import deque
|
||||||
from pathlib import Path
|
|
||||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
@@ -50,13 +46,11 @@ import torch
|
|||||||
import torch.nn as nn
|
import torch.nn as nn
|
||||||
import torch.nn.functional as F
|
import torch.nn.functional as F
|
||||||
from peft import LoraConfig, get_peft_model
|
from peft import LoraConfig, get_peft_model
|
||||||
from safetensors.torch import load_file
|
|
||||||
from torch import Tensor
|
from torch import Tensor
|
||||||
from torch.distributions import Beta
|
from torch.distributions import Beta
|
||||||
from torch.nn import CrossEntropyLoss
|
from torch.nn import CrossEntropyLoss
|
||||||
from torchdiffeq import odeint
|
from torchdiffeq import odeint
|
||||||
from transformers import AutoConfig, AutoProcessor
|
from transformers import AutoProcessor
|
||||||
from transformers.activations import ACT2FN
|
|
||||||
from transformers.cache_utils import (
|
from transformers.cache_utils import (
|
||||||
StaticCache,
|
StaticCache,
|
||||||
)
|
)
|
||||||
@@ -64,11 +58,10 @@ from transformers.utils import is_torchdynamo_compiling, logging
|
|||||||
from transformers import AutoProcessor, BatchFeature
|
from transformers import AutoProcessor, BatchFeature
|
||||||
from qwen_vl_utils.vision_process import smart_resize
|
from qwen_vl_utils.vision_process import smart_resize
|
||||||
|
|
||||||
from lerobot.configs.policies import PreTrainedConfig
|
from lerobot.policies.pretrained import PreTrainedPolicy
|
||||||
from lerobot.policies.pretrained import PreTrainedPolicy, T
|
|
||||||
from lerobot.policies.utils import populate_queues
|
from lerobot.policies.utils import populate_queues
|
||||||
from lerobot.policies.wall_x.configuration_wall_x import WallXConfig
|
from lerobot.policies.wall_x.configuration_wall_x import WallXConfig
|
||||||
from lerobot.utils.constants import ACTION, OBS_LANGUAGE_ATTENTION_MASK, OBS_LANGUAGE_TOKENS, OBS_STATE
|
from lerobot.utils.constants import ACTION, OBS_STATE
|
||||||
|
|
||||||
from lerobot.policies.wall_x.utils import *
|
from lerobot.policies.wall_x.utils import *
|
||||||
from lerobot.policies.wall_x.constant import *
|
from lerobot.policies.wall_x.constant import *
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ Contains data processing utilities, text formatting functions, and helper classe
|
|||||||
for the Wall-X cross-embodiment robotic control model.
|
for the Wall-X cross-embodiment robotic control model.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import json
|
|
||||||
import random
|
import random
|
||||||
import re
|
import re
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
@@ -626,13 +625,11 @@ def replace_action_token(
|
|||||||
text: List of text strings with action placeholders
|
text: List of text strings with action placeholders
|
||||||
norm_action: Normalized action tensors
|
norm_action: Normalized action tensors
|
||||||
action_tokenizer: Tokenizer for converting actions to tokens
|
action_tokenizer: Tokenizer for converting actions to tokens
|
||||||
dataset_names: Names of datasets for each sample
|
|
||||||
dof_masks: Masks for degrees of freedom
|
dof_masks: Masks for degrees of freedom
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
List of text strings with action tokens replaced
|
List of text strings with action tokens replaced
|
||||||
"""
|
"""
|
||||||
# Filter out multimodal dataset names
|
|
||||||
if action_tokenizer is not None and norm_action is not None:
|
if action_tokenizer is not None and norm_action is not None:
|
||||||
# Extract actions based on chunk sizes and DOF masks
|
# Extract actions based on chunk sizes and DOF masks
|
||||||
norm_action = [
|
norm_action = [
|
||||||
|
|||||||
Reference in New Issue
Block a user