mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-23 09:46:00 +00:00
fix(style): pre-commit
This commit is contained in:
@@ -1670,7 +1670,7 @@ class GrootN17PackInputsStep(ProcessorStep):
|
|||||||
|
|
||||||
Relative groups normalize with per-chunk-timestep (2D) ``relative_action`` stats, which the
|
Relative groups normalize with per-chunk-timestep (2D) ``relative_action`` stats, which the
|
||||||
flat ``_min_max_norm`` fallback cannot honor, so a relative config that fails grouped
|
flat ``_min_max_norm`` fallback cannot honor, so a relative config that fails grouped
|
||||||
normalization must fail loudly rather than silently mis-scale every timestep.
|
normalization must fail loudly rather than silently wrongly scale every timestep.
|
||||||
"""
|
"""
|
||||||
if not isinstance(self.modality_config, dict):
|
if not isinstance(self.modality_config, dict):
|
||||||
return False
|
return False
|
||||||
@@ -1807,7 +1807,7 @@ class GrootN17PackInputsStep(ProcessorStep):
|
|||||||
"relative-action chunk: the action layout or horizon does not match the "
|
"relative-action chunk: the action layout or horizon does not match the "
|
||||||
f"checkpoint relative_action stats (action shape {tuple(action.shape)}). The flat "
|
f"checkpoint relative_action stats (action shape {tuple(action.shape)}). The flat "
|
||||||
"min/max fallback cannot honor per-chunk-timestep relative stats, so refusing to "
|
"min/max fallback cannot honor per-chunk-timestep relative stats, so refusing to "
|
||||||
"silently mis-normalize. Recompute the relative action stats so their horizon and "
|
"silently wrongly normalize. Recompute the relative action stats so their horizon and "
|
||||||
"dimensions match the action chunk."
|
"dimensions match the action chunk."
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -1022,7 +1022,7 @@ def test_groot_n1_7_pack_inputs_normalizes_action_chunk_per_dimension_before_pad
|
|||||||
|
|
||||||
def test_groot_n1_7_pack_inputs_raises_when_relative_groups_cannot_normalize():
|
def test_groot_n1_7_pack_inputs_raises_when_relative_groups_cannot_normalize():
|
||||||
# Relative groups carry per-chunk-timestep stats; if the action horizon exceeds the available
|
# Relative groups carry per-chunk-timestep stats; if the action horizon exceeds the available
|
||||||
# stat rows, grouped normalization cannot apply and the flat fallback would silently mis-scale.
|
# stat rows, grouped normalization cannot apply and the flat fallback would silently wrongly scale.
|
||||||
step = GrootN17PackInputsStep(
|
step = GrootN17PackInputsStep(
|
||||||
action_horizon=3,
|
action_horizon=3,
|
||||||
valid_action_horizon=3,
|
valid_action_horizon=3,
|
||||||
|
|||||||
@@ -62,10 +62,7 @@ def make_observation(seed: int, video_keys, lang_key, state_spec):
|
|||||||
# One ndarray per state key, shape (B, T=1, key_dim); dim taken from statistics.
|
# One ndarray per state key, shape (B, T=1, key_dim); dim taken from statistics.
|
||||||
# Keys with dim 0 (e.g. disabled eef on some embodiments) are still emitted as
|
# Keys with dim 0 (e.g. disabled eef on some embodiments) are still emitted as
|
||||||
# present-but-empty so the processor's state transform finds every expected key.
|
# present-but-empty so the processor's state transform finds every expected key.
|
||||||
state = {
|
state = {k: rng.standard_normal((BATCH_SIZE, 1, dim)).astype(np.float32) for k, dim in state_spec}
|
||||||
k: rng.standard_normal((BATCH_SIZE, 1, dim)).astype(np.float32)
|
|
||||||
for k, dim in state_spec
|
|
||||||
}
|
|
||||||
language = {lang_key: [[PROMPT] for _ in range(BATCH_SIZE)]}
|
language = {lang_key: [[PROMPT] for _ in range(BATCH_SIZE)]}
|
||||||
return {"video": video, "state": state, "language": language}
|
return {"video": video, "state": state, "language": language}
|
||||||
|
|
||||||
@@ -181,7 +178,12 @@ def main():
|
|||||||
state_spec = [(k, len(v["min"])) for k, v in stats[tag]["state"].items()]
|
state_spec = [(k, len(v["min"])) for k, v in stats[tag]["state"].items()]
|
||||||
try:
|
try:
|
||||||
dump_one_tag(
|
dump_one_tag(
|
||||||
policy, fair_model, tag, all_modality[tag], state_spec, args,
|
policy,
|
||||||
|
fair_model,
|
||||||
|
tag,
|
||||||
|
all_modality[tag],
|
||||||
|
state_spec,
|
||||||
|
args,
|
||||||
out_dir / f"original_n1_7_{tag}.npz",
|
out_dir / f"original_n1_7_{tag}.npz",
|
||||||
)
|
)
|
||||||
done.append(tag)
|
done.append(tag)
|
||||||
|
|||||||
Reference in New Issue
Block a user