fix: DEFAULT FEATURES must be present when creating metadata. If not, then we raise. this is a first step towards standardazing the dataset format, or otherwise (as it is now) everything would be allowed

This commit is contained in:
Francesco Capuano
2025-11-06 00:47:38 +00:00
parent c87fd37736
commit 13a429e5c7
+3 -1
View File
@@ -512,7 +512,9 @@ class LeRobotDatasetMetadata:
obj.root.mkdir(parents=True, exist_ok=False)
features = {**features, **DEFAULT_FEATURES}
assert set(DEFAULT_FEATURES.keys()).issubset(set(features.keys())), (
f"Default features must be a subset of the provided features! Got {set(features.keys())} and {set(DEFAULT_FEATURES.keys())}"
)
_validate_feature_names(features)
obj.tasks = None