From 3b31c2d9d38bf10e074d3c0d9a264b64895cfd09 Mon Sep 17 00:00:00 2001 From: Pepijn Date: Tue, 25 Nov 2025 16:25:58 +0100 Subject: [PATCH] pass stats --- src/lerobot/policies/factory.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lerobot/policies/factory.py b/src/lerobot/policies/factory.py index 732b1fa30..12dfb1aa0 100644 --- a/src/lerobot/policies/factory.py +++ b/src/lerobot/policies/factory.py @@ -433,6 +433,9 @@ def make_policy( cfg.input_features = {key: ft for key, ft in features.items() if key not in cfg.output_features} kwargs["config"] = cfg + # Pass dataset_stats to the policy if available (needed for some policies like SARM) + if ds_meta is not None and hasattr(ds_meta, 'stats'): + kwargs["dataset_stats"] = ds_meta.stats if cfg.pretrained_path: # Load a pretrained policy and override the config if needed (for example, if there are inference-time