Add Wall-X serving and Turtle2 TCP WebSocket bridge
Pre-commit / pre-commit (push) Canceled after 0s
Pre-commit / pre-commit (push) Canceled after 0s
This commit is contained in:
@@ -9,6 +9,7 @@ from typing import Protocol, SupportsIndex, TypeVar
|
||||
import numpy as np
|
||||
import torch
|
||||
from lerobot.datasets.lerobot_dataset import LeRobotDataset, LeRobotDatasetMetadata
|
||||
from lerobot.datasets.utils import check_delta_timestamps, get_delta_indices
|
||||
from qwen_vl_utils.vision_process import smart_resize
|
||||
from torch.utils.data import DistributedSampler, random_split
|
||||
from transformers import AutoProcessor
|
||||
@@ -788,6 +789,27 @@ def load_lerobot_data(
|
||||
video_backend="pyav",
|
||||
)
|
||||
|
||||
# Some locally patched LeRobot releases return from timestamp
|
||||
# validation before initializing delta_indices. Restore the normal
|
||||
# upstream behavior so action chunks contain the requested horizon.
|
||||
if (
|
||||
train_dataset.delta_timestamps is not None
|
||||
and train_dataset.delta_indices is None
|
||||
):
|
||||
check_delta_timestamps(
|
||||
train_dataset.delta_timestamps,
|
||||
train_dataset.fps,
|
||||
train_dataset.tolerance_s,
|
||||
)
|
||||
train_dataset.delta_indices = get_delta_indices(
|
||||
train_dataset.delta_timestamps, train_dataset.fps
|
||||
)
|
||||
logger.warning(
|
||||
"[Global rank %s] LeRobot did not initialize delta_indices; "
|
||||
"restored them in Wall-X for action chunk loading",
|
||||
global_rank,
|
||||
)
|
||||
|
||||
logger.info(
|
||||
"[Global rank %s] Finished loading on local_rank=%s",
|
||||
global_rank,
|
||||
|
||||
Reference in New Issue
Block a user