mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-20 00:11:59 +00:00
fix(advantage): update frame count calculation in constant mode
This commit is contained in:
@@ -261,7 +261,7 @@ class AdvantageModule:
|
|||||||
|
|
||||||
def _run_constant_mode(self, record: EpisodeRecord, staging: EpisodeStaging) -> None:
|
def _run_constant_mode(self, record: EpisodeRecord, staging: EpisodeStaging) -> None:
|
||||||
"""Emit a fixed advantage value for every frame (with dropout for CFG)."""
|
"""Emit a fixed advantage value for every frame (with dropout for CFG)."""
|
||||||
num_frames = record.num_frames
|
num_frames = len(record.frame_timestamps)
|
||||||
rng = np.random.default_rng(seed=self.config.seed + record.episode_index)
|
rng = np.random.default_rng(seed=self.config.seed + record.episode_index)
|
||||||
|
|
||||||
rows: list[dict[str, Any]] = []
|
rows: list[dict[str, Any]] = []
|
||||||
@@ -269,14 +269,12 @@ class AdvantageModule:
|
|||||||
if rng.random() < self.config.dropout_rate:
|
if rng.random() < self.config.dropout_rate:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
timestamp = float(record.frame_timestamps[t]) if t < len(record.frame_timestamps) else 0.0
|
|
||||||
|
|
||||||
rows.append(
|
rows.append(
|
||||||
{
|
{
|
||||||
"role": "user",
|
"role": "user",
|
||||||
"content": self.config.constant_value,
|
"content": self.config.constant_value,
|
||||||
"style": "advantage",
|
"style": "advantage",
|
||||||
"timestamp": timestamp,
|
"timestamp": float(record.frame_timestamps[t]),
|
||||||
"camera": None,
|
"camera": None,
|
||||||
"tool_calls": None,
|
"tool_calls": None,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user