镜像自地址
https://github.com/MINT-SJTU/Evo-RL.git
已同步 2026-11-20 18:17:06 +00:00
chore(ci): make quality checks pass across repo
- fix ruff violations in dataset, recording, and value modules - fix typos findings and markdown/workflow lint issues - update pages workflow checkout to disable credential persistence - apply pre-commit auto-formatting and EOF normalization - include requested repo housekeeping updates (.gitignore and README)
这个提交包含在:
@ -729,7 +729,9 @@ def test_delete_episodes_preserves_extra_episode_metadata(tmp_path, empty_lerobo
|
||||
)
|
||||
|
||||
assert "episode_success" in new_dataset.meta.episodes.column_names
|
||||
assert [new_dataset.meta.episodes[i]["episode_success"] for i in range(new_dataset.meta.total_episodes)] == [
|
||||
assert [
|
||||
new_dataset.meta.episodes[i]["episode_success"] for i in range(new_dataset.meta.total_episodes)
|
||||
] == [
|
||||
"success",
|
||||
"success",
|
||||
]
|
||||
|
||||
@ -15,9 +15,8 @@
|
||||
# limitations under the License.
|
||||
|
||||
import json
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
from collections import deque
|
||||
from unittest.mock import MagicMock, patch
|
||||
|
||||
import numpy as np
|
||||
import pytest
|
||||
@ -25,12 +24,12 @@ import torch
|
||||
|
||||
from lerobot.datasets.lerobot_dataset import LeRobotDataset
|
||||
from lerobot.scripts.lerobot_calibrate import CalibrateConfig, calibrate
|
||||
from lerobot.scripts.lerobot_human_inloop_record import human_inloop_record
|
||||
from lerobot.scripts.lerobot_human_inloop_record import (
|
||||
_HumanInloopFailureResetController,
|
||||
_load_failure_reset_pose,
|
||||
_save_failure_reset_pose,
|
||||
_slow_reset_all_arms_to_pose,
|
||||
human_inloop_record,
|
||||
)
|
||||
from lerobot.scripts.lerobot_record import (
|
||||
ACPInferenceConfig,
|
||||
@ -39,8 +38,8 @@ from lerobot.scripts.lerobot_record import (
|
||||
RecordConfig,
|
||||
_capture_policy_runtime_state,
|
||||
_predict_policy_action_with_acp_inference,
|
||||
record_loop,
|
||||
record,
|
||||
record_loop,
|
||||
)
|
||||
from lerobot.scripts.lerobot_replay import DatasetReplayConfig, ReplayConfig, replay
|
||||
from lerobot.scripts.lerobot_teleoperate import TeleoperateConfig, teleoperate
|
||||
@ -211,9 +210,7 @@ def test_record_loop_sets_leader_manual_control_during_reset():
|
||||
|
||||
|
||||
def test_save_and_load_failure_reset_pose(tmp_path):
|
||||
robot = MockRobot(
|
||||
MockRobotConfig(n_motors=2, random_values=False, static_values=[12.5, -3.0])
|
||||
)
|
||||
robot = MockRobot(MockRobotConfig(n_motors=2, random_values=False, static_values=[12.5, -3.0]))
|
||||
robot.connect()
|
||||
pose_path = tmp_path / "failure_reset_pose.json"
|
||||
|
||||
|
||||
@ -9,7 +9,9 @@ def test_contiguous_distributed_eval_sampler_has_contiguous_shards_with_tail_pad
|
||||
|
||||
shards: list[list[int]] = []
|
||||
for rank in range(world_size):
|
||||
sampler = ContiguousDistributedEvalSampler(dataset_size=dataset_size, num_replicas=world_size, rank=rank)
|
||||
sampler = ContiguousDistributedEvalSampler(
|
||||
dataset_size=dataset_size, num_replicas=world_size, rank=rank
|
||||
)
|
||||
shard = list(iter(sampler))
|
||||
shards.append(shard)
|
||||
assert len(shard) == len(sampler) == 4
|
||||
@ -30,7 +32,9 @@ def test_contiguous_distributed_eval_sampler_handles_more_ranks_than_samples():
|
||||
|
||||
shards: list[list[int]] = []
|
||||
for rank in range(world_size):
|
||||
sampler = ContiguousDistributedEvalSampler(dataset_size=dataset_size, num_replicas=world_size, rank=rank)
|
||||
sampler = ContiguousDistributedEvalSampler(
|
||||
dataset_size=dataset_size, num_replicas=world_size, rank=rank
|
||||
)
|
||||
shard = list(iter(sampler))
|
||||
shards.append(shard)
|
||||
assert len(shard) == len(sampler) == 1
|
||||
|
||||
@ -13,8 +13,7 @@ from lerobot.configs.value import (
|
||||
ValueInferencePipelineConfig,
|
||||
ValueInferenceVizConfig,
|
||||
)
|
||||
from lerobot.scripts import lerobot_value_infer as value_infer
|
||||
from lerobot.scripts import value_infer_viz
|
||||
from lerobot.scripts import lerobot_value_infer as value_infer, value_infer_viz
|
||||
|
||||
|
||||
class _FakeHFDataset:
|
||||
|
||||
@ -10,8 +10,6 @@ from torch import nn
|
||||
|
||||
import lerobot.processor.tokenizer_processor as tokenizer_processor
|
||||
import lerobot.values.pistar06.modeling_pistar06 as pistar06_modeling
|
||||
import lerobot.values.pistar06.processor_pistar06 as pistar06_processor
|
||||
from lerobot.configs.value_train import ValueTargetsConfig
|
||||
from lerobot.utils.constants import OBS_LANGUAGE_ATTENTION_MASK, OBS_LANGUAGE_TOKENS, OBS_STATE
|
||||
from lerobot.values.pistar06.configuration_pistar06 import Pistar06Config
|
||||
from lerobot.values.pistar06.modeling_pistar06 import (
|
||||
@ -95,10 +93,7 @@ class _DummyAutoModel:
|
||||
@classmethod
|
||||
def from_pretrained(cls, repo_id, **kwargs):
|
||||
output_loading_info = bool(kwargs.pop("output_loading_info", False))
|
||||
if "siglip" in repo_id.lower():
|
||||
model = _DummyVisionModel()
|
||||
else:
|
||||
model = _DummyLanguageModel()
|
||||
model = _DummyVisionModel() if "siglip" in repo_id.lower() else _DummyLanguageModel()
|
||||
if output_loading_info:
|
||||
return model, {"missing_keys": [], "unexpected_keys": [], "mismatched_keys": []}
|
||||
return model
|
||||
|
||||
在新工单中引用
屏蔽一个用户