mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-01 23:27:08 +00:00
fix(jobs): drop --dataset.root on resume + restore keyboard-control docs
Address the latest Claude review on #3856: - _build_resume_job no longer forwards --dataset.root to the pod (a host-local path it can't read); the fresh-run path already nulls it in build_remote_config_file, so this makes resume consistent. Add a unit test for _pod_forwarded_args covering the drop in both flag forms. - Restore the display-independent keyboard-control docs (n/r/q letter equivalents + X11/Wayland/headless Tip) in il_robots.mdx that this branch was stale on relative to main (#3875).
This commit is contained in:
@@ -256,7 +256,7 @@ def _build_resume_job(cfg: TrainPipelineConfig, username: str) -> tuple[str, lis
|
||||
config_path = parser.parse_arg("config_path")
|
||||
forwarded = _pod_forwarded_args(
|
||||
sys.argv[1:],
|
||||
drop_names=("--config_path", "--policy.repo_id", "--policy.push_to_hub"),
|
||||
drop_names=("--config_path", "--policy.repo_id", "--policy.push_to_hub", "--dataset.root"),
|
||||
drop_prefixes=("--job.",),
|
||||
)
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import pytest
|
||||
|
||||
from lerobot.configs.train import TrainPipelineConfig
|
||||
from lerobot.jobs.hf import (
|
||||
_pod_forwarded_args,
|
||||
_poll_until_done,
|
||||
build_remote_config_file,
|
||||
build_repo_id,
|
||||
@@ -123,6 +124,29 @@ def test_build_repo_id_sanitizes_and_timestamps():
|
||||
assert build_repo_id("alice", "///", now) == "alice/train_2026-06-19_10-22-03"
|
||||
|
||||
|
||||
def test_pod_forwarded_args_drops_host_only_flags():
|
||||
"""User overrides are replayed on the pod, minus flags that only make sense on the submitter.
|
||||
|
||||
`--dataset.root` is a host-local path the pod can't read, so it must be dropped in both the
|
||||
`--name=value` and `--name value` forms; unrelated overrides are forwarded untouched.
|
||||
"""
|
||||
argv = [
|
||||
"--config_path=u/d",
|
||||
"--dataset.root=/local/data",
|
||||
"--dataset.root",
|
||||
"/other/local/data",
|
||||
"--policy.repo_id=u/keep",
|
||||
"--steps=10",
|
||||
"--job.target=a10g-small",
|
||||
]
|
||||
forwarded = _pod_forwarded_args(
|
||||
argv,
|
||||
drop_names=("--config_path", "--policy.repo_id", "--policy.push_to_hub", "--dataset.root"),
|
||||
drop_prefixes=("--job.",),
|
||||
)
|
||||
assert forwarded == ["--steps=10"]
|
||||
|
||||
|
||||
def _minimal_cfg():
|
||||
return draccus.parse(
|
||||
TrainPipelineConfig,
|
||||
|
||||
Reference in New Issue
Block a user